Fix detection of sneaking node
authorgregorycu <gregory.currie@gmail.com>
Sun, 1 Feb 2015 03:40:50 +0000 (14:40 +1100)
committerkwolekr <kwolekr@minetest.net>
Thu, 6 Aug 2015 07:14:56 +0000 (03:14 -0400)
This fixes bug 1551

src/localplayer.cpp

index 1a59504ef85dc096e0a276f53e02d9cf4858e6f6..aee8622005988e06260b0100215852651afb3e5d 100644 (file)
@@ -230,7 +230,7 @@ void LocalPlayer::move(f32 dtime, Environment *env, f32 pos_max_d,
                player is sneaking from, if any.  If the node from under
                the player has been removed, the player falls.
        */
-       v3s16 current_node = floatToInt(position - v3f(0,BS/2,0), BS);
+       v3s16 current_node = floatToInt(position - v3f(0, 0.05 * BS, 0), BS);
        if(m_sneak_node_exists &&
           nodemgr->get(map->getNodeNoEx(m_old_node_below)).name == "air" &&
           m_old_node_below_type != "air")
@@ -248,7 +248,7 @@ void LocalPlayer::move(f32 dtime, Environment *env, f32 pos_max_d,
        }
        if(m_need_to_get_new_sneak_node && physics_override_sneak)
        {
-               v3s16 pos_i_bottom = floatToInt(position - v3f(0,BS/2,0), BS);
+               v3s16 pos_i_bottom = floatToInt(position - v3f(0, 0.05 * BS ,0), BS);
                v2f player_p2df(position.X, position.Z);
                f32 min_distance_f = 100000.0*BS;
                // If already seeking from some node, compare to it.