LocalPlayer::getStandingNodePos()
authorPerttu Ahola <celeron55@gmail.com>
Fri, 23 Mar 2012 15:33:22 +0000 (17:33 +0200)
committerPerttu Ahola <celeron55@gmail.com>
Sat, 24 Mar 2012 02:24:26 +0000 (04:24 +0200)
src/player.cpp
src/player.h

index 40b7a249793298aefec58d9b09c429f837b2077d..48d2c2907abebac43b1cd9607ae5d0fa9211cf92 100644 (file)
@@ -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
 
index d62fb611116bfddae84bd69736d68fd0833bceeb..d0e1ac79923b7d521fe362e4d65513dc75e97d49 100644 (file)
@@ -236,6 +236,8 @@ public:
        void move(f32 dtime, Map &map, f32 pos_max_d);
 
        void applyControl(float dtime);
+
+       v3s16 getStandingNodePos();
        
        PlayerControl control;