aboutsummaryrefslogtreecommitdiff
path: root/src/player.cpp
diff options
context:
space:
mode:
authorPerttu Ahola <celeron55@gmail.com>2012-03-23 17:33:22 +0200
committerPerttu Ahola <celeron55@gmail.com>2012-03-24 04:24:26 +0200
commite53794868eaa33199a1f1011b2d5f517b6f68057 (patch)
tree37a43c581575cde9af618764f2d09868129e9ef3 /src/player.cpp
parent8c2f3bb378640c921a0ad40c4577687b0c7c37f3 (diff)
downloadminetest-e53794868eaa33199a1f1011b2d5f517b6f68057.tar.gz
minetest-e53794868eaa33199a1f1011b2d5f517b6f68057.tar.bz2
minetest-e53794868eaa33199a1f1011b2d5f517b6f68057.zip
LocalPlayer::getStandingNodePos()
Diffstat (limited to 'src/player.cpp')
-rw-r--r--src/player.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/player.cpp b/src/player.cpp
index 40b7a2497..48d2c2907 100644
--- a/src/player.cpp
+++ b/src/player.cpp
@@ -759,5 +759,13 @@ void LocalPlayer::applyControl(float dtime)
// Accelerate to target speed with maximum increment
accelerate(speed, inc);
}
+
+v3s16 LocalPlayer::getStandingNodePos()
+{
+ if(m_sneak_node_exists)
+ return m_sneak_node;
+ return floatToInt(getPosition(), BS);
+}
+
#endif