X-Git-Url: https://de.git.xonotic.org/?a=blobdiff_plain;f=qcsrc%2Fcommon%2Fphysics%2Fmovetypes%2Fwalk.qc;h=6e4c548d6cd8aecdd2ced19a27d7f31b406524bf;hb=c72d8802ab6a8df4072e8342a5fe8750619c5855;hp=45b1dc39ccbe4c18a978a617bc7b90120df357b1;hpb=a4bcbda7a1eb2367fae1c2514d474d426803a673;p=xonotic%2Fxonotic-data.pk3dir.git diff --git a/qcsrc/common/physics/movetypes/walk.qc b/qcsrc/common/physics/movetypes/walk.qc index 45b1dc39c..6e4c548d6 100644 --- a/qcsrc/common/physics/movetypes/walk.qc +++ b/qcsrc/common/physics/movetypes/walk.qc @@ -1,3 +1,4 @@ +#include "walk.qh" void _Movetype_Physics_Walk(entity this, float dt) // SV_WalkMove { vector stepnormal = '0 0 0'; @@ -19,6 +20,14 @@ void _Movetype_Physics_Walk(entity this, float dt) // SV_WalkMove vector start_origin = this.origin; vector start_velocity = this.velocity; + if(PHYS_WALLCLIP(this) && this.pm_time) + { + if(dt >= this.pm_time || (this.flags & FL_WATERJUMP)) + this.pm_time = 0; + else + this.pm_time -= dt; + } + int clip = _Movetype_FlyMove(this, dt, applygravity, stepnormal, GAMEPLAYFIX_STEPMULTIPLETIMES(this) ? PHYS_STEPHEIGHT(this) : 0); if (GAMEPLAYFIX_DOWNTRACEONGROUND(this) && !(clip & 1)) @@ -44,6 +53,8 @@ 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)) UNSET_ONGROUND(this); + else if(PHYS_WALLCLIP(this) && !this.groundentity && (PHYS_WALLCLIP(this) == 2 || start_velocity.z < -200)) // don't do landing time if we were just going down a slope + this.pm_time = 0.25; _Movetype_CheckVelocity(this); _Movetype_LinkEdict(this, true); @@ -61,7 +72,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 +135,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; @@ -143,7 +154,8 @@ void _Movetype_Physics_Walk(entity this, float dt) // SV_WalkMove } // move down - vector downmove = '0 0 1' * (-PHYS_STEPHEIGHT(this) + start_velocity.z * dt); + vector downmove = '0 0 0'; + downmove.z = -PHYS_STEPHEIGHT(this) + start_velocity.z * dt; _Movetype_PushEntity(this, downmove, true); if(wasfreed(this)) return; @@ -168,7 +180,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);