Last active
December 12, 2015 12:29
-
-
Save PilzAdam/4772323 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/src/localplayer.cpp b/src/localplayer.cpp | |
index 4e0bccf..ea85ca6 100644 | |
--- a/src/localplayer.cpp | |
+++ b/src/localplayer.cpp | |
@@ -46,7 +46,8 @@ | |
m_old_node_below(32767,32767,32767), | |
m_old_node_below_type("air"), | |
m_need_to_get_new_sneak_node(true), | |
- m_can_jump(false) | |
+ m_can_jump(false), | |
+ m_liquid_viscosity(0) | |
{ | |
// Initialize hp to 0, so that no hearts will be shown if server | |
// doesn't support health points | |
@@ -98,17 +99,20 @@ void LocalPlayer::move(f32 dtime, Map &map, f32 pos_max_d, | |
{ | |
v3s16 pp = floatToInt(position + v3f(0,BS*0.1,0), BS); | |
in_water = nodemgr->get(map.getNode(pp).getContent()).isLiquid(); | |
+ m_liquid_viscosity = nodemgr->get(map.getNode(pp).getContent()).liquid_viscosity; | |
} | |
// If not in water, the threshold of going in is at lower y | |
else | |
{ | |
v3s16 pp = floatToInt(position + v3f(0,BS*0.5,0), BS); | |
in_water = nodemgr->get(map.getNode(pp).getContent()).isLiquid(); | |
+ m_liquid_viscosity = nodemgr->get(map.getNode(pp).getContent()).liquid_viscosity; | |
} | |
} | |
catch(InvalidPositionException &e) | |
{ | |
in_water = false; | |
+ m_liquid_viscosity = 0; | |
} | |
/* | |
diff --git a/src/localplayer.h b/src/localplayer.h | |
index c9d010d..f54a57c 100644 | |
--- a/src/localplayer.h | |
+++ b/src/localplayer.h | |
@@ -64,6 +64,7 @@ class LocalPlayer : public Player | |
// Whether recalculation of the sneak node is needed | |
bool m_need_to_get_new_sneak_node; | |
bool m_can_jump; | |
+ u8 m_liquid_viscosity; | |
}; | |
#endif |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment