]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/common/physics/movetypes/walk.qc
Merge branch 'master' into martin-t/dmgtext2
[xonotic/xonotic-data.pk3dir.git] / qcsrc / common / physics / movetypes / walk.qc
index 24c9c8c5ea64d6f8e171b85bd26ebe71c33bf311..c20e82e8342825a9282142d288281ceffea2583d 100644 (file)
@@ -1,3 +1,4 @@
+#include "walk.qh"
 void _Movetype_Physics_Walk(entity this, float dt)  // SV_WalkMove
 {
        vector stepnormal = '0 0 0';
@@ -14,7 +15,7 @@ void _Movetype_Physics_Walk(entity this, float dt)  // SV_WalkMove
        _Movetype_CheckVelocity(this);
 
        // do a regular slide move unless it looks like you ran into a step
-       bool oldonground = (this.flags & FL_ONGROUND);
+       bool oldonground = IS_ONGROUND(this);
 
        vector start_origin = this.origin;
        vector start_velocity = this.velocity;
@@ -43,7 +44,7 @@ void _Movetype_Physics_Walk(entity this, float dt)  // SV_WalkMove
 
        // if the move did not hit the ground at any point, we're not on ground
        if (!(clip & 1))
-               this.flags &= ~FL_ONGROUND;
+               UNSET_ONGROUND(this);
 
        _Movetype_CheckVelocity(this);
        _Movetype_LinkEdict(this, true);
@@ -61,7 +62,7 @@ void _Movetype_Physics_Walk(entity this, float dt)  // SV_WalkMove
        vector originalvelocity = this.velocity;
        // originalmove_clip = clip;
        int originalflags = this.flags;
-       entity originalmove_groundentity = this.move_groundentity;
+       entity originalmove_groundentity = this.groundentity;
 
        // if move didn't block on a step, return
        if (clip & 2)
@@ -124,7 +125,7 @@ void _Movetype_Physics_Walk(entity this, float dt)  // SV_WalkMove
                        this.velocity = originalvelocity;
                        // clip = originalmove_clip;
                        this.flags = originalflags;
-                       this.move_groundentity = originalmove_groundentity;
+                       this.groundentity = originalmove_groundentity;
                        // now try to unstick if needed
                        // clip = SV_TryUnstick (ent, oldvel);
                        return;
@@ -137,7 +138,7 @@ void _Movetype_Physics_Walk(entity this, float dt)  // SV_WalkMove
                        _Movetype_WallFriction(this, 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 || (this.flags & FL_ONGROUND))
+       else if (!GAMEPLAYFIX_STEPDOWN(this) || this.waterlevel >= 3 || start_velocity.z >= (1.0 / 32.0) || !oldonground || IS_ONGROUND(this))
        {
                return;
        }
@@ -168,7 +169,7 @@ void _Movetype_Physics_Walk(entity this, float dt)  // SV_WalkMove
                this.origin = originalorigin;
                this.velocity = originalvelocity;
                this.flags = originalflags;
-               this.move_groundentity = originalmove_groundentity;
+               this.groundentity = originalmove_groundentity;
        }
 
        _Movetype_CheckVelocity(this);