+#include "walk.qh"
void _Movetype_Physics_Walk(entity this, float dt) // SV_WalkMove
{
vector stepnormal = '0 0 0';
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))
// 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);
}
// 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;