aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorDániel Juhász <juhdanad@gmail.com>2017-06-24 18:15:00 +0000
committerLoïc Blot <nerzhul@users.noreply.github.com>2017-06-24 20:15:00 +0200
commitc2df1a08351101034f52fd2810051715714c9c40 (patch)
tree799c2a4e6cbc4401f18fd21587ba93196a324998 /src
parent9da5fb1583211b44afa4d28f3ccb64d768c56771 (diff)
downloadminetest-c2df1a08351101034f52fd2810051715714c9c40.tar.gz
minetest-c2df1a08351101034f52fd2810051715714c9c40.tar.bz2
minetest-c2df1a08351101034f52fd2810051715714c9c40.zip
Emit liquid sound if the player walks in liquid (#6040)
Diffstat (limited to 'src')
-rw-r--r--src/localplayer.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/localplayer.cpp b/src/localplayer.cpp
index aa38f338d..a77dcab0a 100644
--- a/src/localplayer.cpp
+++ b/src/localplayer.cpp
@@ -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.