]> git.lizzy.rs Git - minetest.git/commitdiff
Emit liquid sound if the player walks in liquid (#6040)
authorDániel Juhász <juhdanad@gmail.com>
Sat, 24 Jun 2017 18:15:00 +0000 (18:15 +0000)
committerLoïc Blot <nerzhul@users.noreply.github.com>
Sat, 24 Jun 2017 18:15:00 +0000 (20:15 +0200)
src/localplayer.cpp

index aa38f338d0af067a9f6abc44be6676bcd3152040..a77dcab0a6708915708f8ca14743f017ce324133 100644 (file)
@@ -723,6 +723,9 @@ v3s16 LocalPlayer::getStandingNodePos()
 
 v3s16 LocalPlayer::getFootstepNodePos()
 {
+       if (in_liquid_stable)
+               // Emit swimming sound if the player is in liquid
+               return floatToInt(getPosition(), BS);
        if (touching_ground)
                // BS * 0.05 below the player's feet ensures a 1/16th height
                // nodebox is detected instead of the node below it.