mirror of
https://github.com/luanti-org/luanti.git
synced 2025-06-27 16:36:03 +00:00
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.
This commit is contained in:
parent
1de08e1961
commit
984e063374
3 changed files with 14 additions and 1 deletions
|
@ -68,6 +68,7 @@ public:
|
|||
void applyControl(float dtime);
|
||||
|
||||
v3s16 getStandingNodePos();
|
||||
v3s16 getFootstepNodePos();
|
||||
|
||||
// Used to check if anything changed and prevent sending packets if not
|
||||
v3f last_position;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue