From: Perttu Ahola Date: Fri, 23 Mar 2012 15:33:22 +0000 (+0200) Subject: LocalPlayer::getStandingNodePos() X-Git-Url: http://81.2.79.47:8989/gitweb/?a=commitdiff_plain;h=e53794868eaa33199a1f1011b2d5f517b6f68057;p=zefram%2Fminetest%2Fminetest_engine.git LocalPlayer::getStandingNodePos() --- diff --git a/src/player.cpp b/src/player.cpp index 40b7a249..48d2c290 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 diff --git a/src/player.h b/src/player.h index d62fb611..d0e1ac79 100644 --- a/src/player.h +++ b/src/player.h @@ -236,6 +236,8 @@ public: void move(f32 dtime, Map &map, f32 pos_max_d); void applyControl(float dtime); + + v3s16 getStandingNodePos(); PlayerControl control;