]> git.lizzy.rs Git - minetest.git/blobdiff - src/localplayer.cpp
Mgvalleys: use standard caves
[minetest.git] / src / localplayer.cpp
index 77e7a9e16f426a45ea9c94e9095ea3210d1c05fe..60aec95d4a69f88bf6393353ae6ea54dd59d4e95 100644 (file)
@@ -42,6 +42,7 @@ LocalPlayer::LocalPlayer(IGameDef *gamedef, const char *name):
        last_pitch(0),
        last_yaw(0),
        last_keyPressed(0),
+       camera_impact(0.f),
        last_animation(NO_ANIM),
        hotbar_image(""),
        hotbar_selected_image(""),
@@ -213,8 +214,8 @@ void LocalPlayer::move(f32 dtime, Environment *env, f32 pos_max_d,
        v3f accel_f = v3f(0,0,0);
 
        collisionMoveResult result = collisionMoveSimple(env, m_gamedef,
-                       pos_max_d, m_collisionbox, player_stepheight, dtime,
-                       position, m_speed, accel_f);
+               pos_max_d, m_collisionbox, player_stepheight, dtime,
+               &position, &m_speed, accel_f);
 
        /*
                If the player's feet touch the topside of any node, this is
@@ -344,7 +345,7 @@ void LocalPlayer::move(f32 dtime, Environment *env, f32 pos_max_d,
                }
        }
 
-       if(!touching_ground_was && touching_ground){
+       if(!result.standing_on_object && !touching_ground_was && touching_ground) {
                MtEvent *e = new SimpleTriggerEvent("PlayerRegainGround");
                m_gamedef->event()->put(e);
 
@@ -512,15 +513,16 @@ void LocalPlayer::applyControl(float dtime)
                }
        }
 
-       if(continuous_forward)
+       if (continuous_forward)
                speedH += move_direction;
 
-       if(control.up)
-       {
-               if(continuous_forward)
-                       superspeed = true;
-               else
+       if (control.up) {
+               if (continuous_forward) {
+                       if (fast_move)
+                               superspeed = true;
+               } else {
                        speedH += move_direction;
+               }
        }
        if(control.down)
        {