-
Notifications
You must be signed in to change notification settings - Fork 2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Footsteps without view bobbing #5645
Conversation
3c5602c
to
796020b
Compare
Newest commit (796020b) adds documentation |
src/camera.cpp
Outdated
@@ -280,7 +279,7 @@ void Camera::update(LocalPlayer* player, f32 frametime, f32 busytime, | |||
v3f rel_cam_target = v3f(0,0,1); | |||
v3f rel_cam_up = v3f(0,1,0); | |||
|
|||
if (m_view_bobbing_anim != 0 && m_camera_mode < CAMERA_MODE_THIRD) | |||
if (m_cache_view_bobbing_amount != 0 && m_view_bobbing_anim != 0 && m_camera_mode < CAMERA_MODE_THIRD) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Because '_amount' is a float maybe it should be '!= 0.0f'? Not sure.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Probably a good idea. I'll change it.
Thanks for updating the settings translation file, there's no need to update all the translations files as those are updated only every 1-2 months or so, but thanks anyway. |
796020b
to
c813113
Compare
Changed to using 0.0f for comparison instead of an int. |
src/camera.cpp
Outdated
@@ -280,7 +279,7 @@ void Camera::update(LocalPlayer* player, f32 frametime, f32 busytime, | |||
v3f rel_cam_target = v3f(0,0,1); | |||
v3f rel_cam_up = v3f(0,1,0); | |||
|
|||
if (m_view_bobbing_anim != 0 && m_camera_mode < CAMERA_MODE_THIRD) | |||
if (m_cache_view_bobbing_amount != 0.0f && m_view_bobbing_anim != 0.0f && m_camera_mode < CAMERA_MODE_THIRD) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please split the line at 80 columns (with tab size 4)
+1 once long line is split. |
Also fixes bug where disabling view_bobbing disables footstep sounds.
c813113
to
c5042f2
Compare
Long line has been split. |
👍 |
src/camera.cpp
Outdated
@@ -280,7 +279,8 @@ void Camera::update(LocalPlayer* player, f32 frametime, f32 busytime, | |||
v3f rel_cam_target = v3f(0,0,1); | |||
v3f rel_cam_up = v3f(0,1,0); | |||
|
|||
if (m_view_bobbing_anim != 0 && m_camera_mode < CAMERA_MODE_THIRD) | |||
if (m_cache_view_bobbing_amount != 0.0f && m_view_bobbing_anim != 0.0f && | |||
m_camera_mode < CAMERA_MODE_THIRD) | |||
{ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
brace on wrong line
src/camera.cpp
Outdated
@@ -467,7 +467,6 @@ void Camera::update(LocalPlayer* player, f32 frametime, f32 busytime, | |||
const bool swimming = (movement_XZ || player->swimming_vertical) && player->in_liquid; | |||
const bool climbing = movement_Y && player->is_climbing; | |||
if ((walking || swimming || climbing) && | |||
m_cache_view_bobbing && | |||
(!g_settings->getBool("free_move") || !m_client->checkLocalPrivilege("fly"))) | |||
{ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
place move this brace too
Setting view_bobbing amount to 0 is now the only way to turn view_bobbing on and off. Also fixed a bug where footstep sounds would not play when view_bobbing was disabled.
Moved braces 👍 |
This PR allows the footstep sounds to play without the view bobbing at the same time, as per bug #5602. It also removes the redundant view_bobbing setting from minetest.conf files.