diff options
author | paramat <mat.gregory@virginmedia.com> | 2017-02-09 21:12:53 +0000 |
---|---|---|
committer | paramat <mat.gregory@virginmedia.com> | 2017-02-12 01:52:12 +0000 |
commit | 984e063374c032ed17764931fd00c19afb92ebb9 (patch) | |
tree | 7053082d5c1e96869c9c8f8cb17d8aced0326b16 /src/game.cpp | |
parent | 1de08e196182498a931b496f79b1c1eaf3de7ca4 (diff) | |
download | minetest-984e063374c032ed17764931fd00c19afb92ebb9.tar.gz minetest-984e063374c032ed17764931fd00c19afb92ebb9.tar.bz2 minetest-984e063374c032ed17764931fd00c19afb92ebb9.zip |
Footsteps: Fix offset footstep and shallow water sound bugs
Fix footstep sounds coming from nodes to either side when walking on a
1 node wide row of nodebox slabs such as default:snow.
Fix sand footsteps when swimming in 1 node deep water.
Use a new function 'getFootstepNodePos()' instead of 'getStandingNodePos()'
to avoid using a horizontally-offset 'sneak node' for sounds.
Sound is selected from the node BS * 0.05 below the player's feet, so
that 1/16th slabs will play the slab sound but 1/32nd slabs will not.
If the player is not 'touching ground' the node detection position is
changed to BS * 0.5 below to preserve footstep sounds when landing after
a jump or fall.
Diffstat (limited to 'src/game.cpp')
-rw-r--r-- | src/game.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/game.cpp b/src/game.cpp index 840403c42..1735737de 100644 --- a/src/game.cpp +++ b/src/game.cpp @@ -3530,7 +3530,7 @@ void Game::updateSound(f32 dtime) LocalPlayer *player = client->getEnv().getLocalPlayer(); ClientMap &map = client->getEnv().getClientMap(); - MapNode n = map.getNodeNoEx(player->getStandingNodePos()); + MapNode n = map.getNodeNoEx(player->getFootstepNodePos()); soundmaker->m_player_step_sound = nodedef_manager->get(n).sound_footstep; } |