]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/common/physics/movetypes/walk.qc
Make stepnormal available to the above functions, fixes some discrepancies in QC...
[xonotic/xonotic-data.pk3dir.git] / qcsrc / common / physics / movetypes / walk.qc
index c0f2fac9640be94fa6c550536f029c2197180e38..13224f8a3443d022658aa9307dca2f522979d16f 100644 (file)
@@ -1,8 +1,6 @@
 #include "walk.qh"
 void _Movetype_Physics_Walk(entity this, float dt)  // SV_WalkMove
 {
-       vector stepnormal = '0 0 0';
-
        // if frametime is 0 (due to client sending the same timestamp twice), don't move
        if (dt <= 0)
                return;
@@ -28,7 +26,7 @@ void _Movetype_Physics_Walk(entity this, float dt)  // SV_WalkMove
                        this.pm_time -= dt;
        }
 
-       int clip = _Movetype_FlyMove(this, dt, applygravity, stepnormal, GAMEPLAYFIX_STEPMULTIPLETIMES(this) ? PHYS_STEPHEIGHT(this) : 0);
+       int clip = _Movetype_FlyMove(this, dt, applygravity, false, GAMEPLAYFIX_STEPMULTIPLETIMES(this) ? PHYS_STEPHEIGHT(this) : 0);
 
        if (GAMEPLAYFIX_DOWNTRACEONGROUND(this) && !(clip & 1))
        {
@@ -100,10 +98,7 @@ void _Movetype_Physics_Walk(entity this, float dt)  // SV_WalkMove
 
                // move up
                vector upmove = '0 0 1' * PHYS_STEPHEIGHT(this);
-               _Movetype_PushEntity(this, upmove, true);
-               if(wasfreed(this))
-                       return;
-               if(trace_startsolid)
+               if(!_Movetype_PushEntity(this, upmove, true, true))
                {
                        // we got teleported when upstepping... must abort the move
                        return;
@@ -111,7 +106,7 @@ void _Movetype_Physics_Walk(entity this, float dt)  // SV_WalkMove
 
                // move forward
                this.velocity_z = 0;
-               clip = _Movetype_FlyMove(this, dt, applygravity, stepnormal, 0);
+               clip = _Movetype_FlyMove(this, dt, applygravity, true, 0);
                this.velocity_z += start_velocity.z;
                if (clip & 8)
                {
@@ -145,7 +140,7 @@ void _Movetype_Physics_Walk(entity this, float dt)  // SV_WalkMove
 
                // extra friction based on view angle
                if ((clip & 2) && PHYS_WALLFRICTION(this))
-                       _Movetype_WallFriction(this, stepnormal);
+                       _Movetype_WallFriction(this, move_stepnormal);
        }
        // don't do the down move if stepdown is disabled, moving upward, not in water, or the move started offground or ended onground
        else if (!GAMEPLAYFIX_STEPDOWN(this) || this.waterlevel >= 3 || start_velocity.z >= (1.0 / 32.0) || !oldonground || IS_ONGROUND(this))
@@ -156,11 +151,7 @@ void _Movetype_Physics_Walk(entity this, float dt)  // SV_WalkMove
        // move down
        vector downmove = '0 0 0';
        downmove.z = -PHYS_STEPHEIGHT(this) + start_velocity.z * dt;
-       _Movetype_PushEntity(this, downmove, true);
-       if(wasfreed(this))
-               return;
-
-       if(trace_startsolid)
+       if(!_Movetype_PushEntity(this, downmove, true, true))
        {
                // we got teleported when downstepping... must abort the move
                return;