Skip to content
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

Merged
merged 2 commits into from
Apr 25, 2017
Merged

Conversation

desttinghim
Copy link
Contributor

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.

@desttinghim
Copy link
Contributor Author

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)
Copy link
Contributor

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.

Copy link
Contributor Author

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.

@paramat
Copy link
Contributor

paramat commented Apr 23, 2017

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.

@desttinghim
Copy link
Contributor Author

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)
Copy link
Contributor

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)

@paramat
Copy link
Contributor

paramat commented Apr 23, 2017

+1 once long line is split.

Also fixes bug where disabling view_bobbing disables footstep sounds.
@desttinghim
Copy link
Contributor Author

Long line has been split.

@paramat
Copy link
Contributor

paramat commented Apr 23, 2017

👍

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)
{
Copy link
Member

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")))
{
Copy link
Member

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.
@desttinghim
Copy link
Contributor Author

Moved braces 👍

@Zeno- Zeno- merged commit db17225 into minetest:master Apr 25, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants