]> git.lizzy.rs Git - minetest.git/blobdiff - src/localplayer.cpp
Don't use msvc libs for mingw build
[minetest.git] / src / localplayer.cpp
index 6b7b0943cdc1a3ca6f7961a19fa061c14b8af021..48e6592c19e5252e557b935c75240da985a0c8ec 100644 (file)
@@ -43,6 +43,8 @@ LocalPlayer::LocalPlayer(IGameDef *gamedef):
        last_pitch(0),
        last_yaw(0),
        last_keyPressed(0),
+       hotbar_image(""),
+       hotbar_selected_image(""),
        m_sneak_node(32767,32767,32767),
        m_sneak_node_exists(false),
        m_old_node_below(32767,32767,32767),
@@ -73,6 +75,7 @@ void LocalPlayer::move(f32 dtime, ClientEnvironment *env, f32 pos_max_d,
        if(isAttached)
        {
                setPosition(overridePosition);
+               m_sneak_node_exists = false;
                return;
        }
 
@@ -85,6 +88,7 @@ void LocalPlayer::move(f32 dtime, ClientEnvironment *env, f32 pos_max_d,
        {
         position += m_speed * dtime;
                setPosition(position);
+               m_sneak_node_exists = false;
                return;
        }
 
@@ -154,9 +158,6 @@ void LocalPlayer::move(f32 dtime, ClientEnvironment *env, f32 pos_max_d,
        // This should always apply, otherwise there are glitches
        assert(d > pos_max_d);
 
-       float player_radius = BS*0.30;
-       float player_height = BS*1.55;
-       
        // Maximum distance over border for sneaking
        f32 sneak_max = BS*0.4;
 
@@ -184,24 +185,12 @@ void LocalPlayer::move(f32 dtime, ClientEnvironment *env, f32 pos_max_d,
                }
        }
 
-       /*
-               Calculate player collision box (new and old)
-       */
-       core::aabbox3d<f32> playerbox(
-               -player_radius,
-               0.0,
-               -player_radius,
-               player_radius,
-               player_height,
-               player_radius
-       );
-
        float player_stepheight = touching_ground ? (BS*0.6) : (BS*0.2);
 
        v3f accel_f = v3f(0,0,0);
 
        collisionMoveResult result = collisionMoveSimple(env, m_gamedef,
-                       pos_max_d, playerbox, player_stepheight, dtime,
+                       pos_max_d, m_collisionbox, player_stepheight, dtime,
                        position, m_speed, accel_f);
 
        /*