X-Git-Url: https://git.xonotic.org/?a=blobdiff_plain;f=qcsrc%2Fcommon%2Fphysics%2Fmovetypes%2Fwalk.qc;h=868bf6d35873192a3ffffd39a29aab4dfb80836c;hb=HEAD;hp=e0d05d7c557c9ab112bb2e5c0d704a619d5a082c;hpb=24151b08c3de08e46dace760129f0526a455be4b;p=xonotic%2Fxonotic-data.pk3dir.git diff --git a/qcsrc/common/physics/movetypes/walk.qc b/qcsrc/common/physics/movetypes/walk.qc index e0d05d7c5..868bf6d35 100644 --- a/qcsrc/common/physics/movetypes/walk.qc +++ b/qcsrc/common/physics/movetypes/walk.qc @@ -1,4 +1,5 @@ #include "walk.qh" + void _Movetype_Physics_Walk(entity this, float dt) // SV_WalkMove { // if frametime is 0 (due to client sending the same timestamp twice), don't move @@ -36,16 +37,23 @@ void _Movetype_Physics_Walk(entity this, float dt) // SV_WalkMove vector upmove = this.origin + '0 0 1'; vector downmove = this.origin - '0 0 1'; int type; - if (this.move_movetype == MOVETYPE_FLYMISSILE) + if (this.move_nomonsters) + type = max(0, this.move_nomonsters); + else if (this.move_movetype == MOVETYPE_FLYMISSILE) type = MOVE_MISSILE; else if (this.move_movetype == MOVETYPE_FLY_WORLDONLY) type = MOVE_WORLDONLY; else if (this.solid == SOLID_TRIGGER || this.solid == SOLID_NOT) type = MOVE_NOMONSTERS; - else type = MOVE_NORMAL; + else + type = MOVE_NORMAL; tracebox(upmove, this.mins, this.maxs, downmove, type, this); if (trace_fraction < 1 && trace_plane_normal.z > 0.7) + { clip |= 1; // but we HAVE found a floor + // set groundentity so we get carried when walking onto a mover + this.groundentity = trace_ent; + } } // if the move did not hit the ground at any point, we're not on ground @@ -98,7 +106,7 @@ void _Movetype_Physics_Walk(entity this, float dt) // SV_WalkMove // move up vector upmove = '0 0 1' * PHYS_STEPHEIGHT(this); - if(!_Movetype_PushEntity(this, upmove, true, true)) + if(!_Movetype_PushEntity(this, upmove, true)) { // we got teleported when upstepping... must abort the move return; @@ -152,7 +160,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; - if(!_Movetype_PushEntity(this, downmove, true, true)) + if(!_Movetype_PushEntity(this, downmove, true)) { // we got teleported when downstepping... must abort the move return;