#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;
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))
{
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
// 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;
// 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)
{
// 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))
+ else if (!GAMEPLAYFIX_STEPDOWN(this) || this.waterlevel >= 3 || start_velocity.z >= (1.0 / 32.0)
+ || !oldonground || IS_ONGROUND(this) || (GAMEPLAYFIX_STEPDOWN_MAXSPEED(this) && vdist(start_velocity, >=, GAMEPLAYFIX_STEPDOWN_MAXSPEED(this)) && !IS_ONSLICK(this)))
{
return;
}
// 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;