}
vector planes[MAX_CLIP_PLANES];
-int _Movetype_FlyMove(entity this, float dt, bool applygravity, vector stepnormal, float stepheight) // SV_FlyMove
+int _Movetype_FlyMove(entity this, float dt, bool applygravity, bool applystepnormal, float stepheight) // SV_FlyMove
{
+ move_stepnormal = '0 0 0';
+
if(dt <= 0)
return 0;
// step - return it to caller
blocked |= 2;
// save the trace for player extrafriction
- if(stepnormal)
- stepnormal = trace_plane_normal;
+ if(applystepnormal)
+ move_stepnormal = trace_plane_normal;
}
if(my_trace_fraction >= 0.001)
const int UNSTICK_FIXED = 1;
const int UNSTICK_STUCK = 2;
+// set by _Movetype_FlyMove
+vector move_stepnormal;
+
void _Movetype_WallFriction(entity this, vector stepnormal);
-int _Movetype_FlyMove(entity this, float dt, bool applygravity, vector stepnormal, float stepheight);
+int _Movetype_FlyMove(entity this, float dt, bool applygravity, bool applystepnormal, float stepheight);
void _Movetype_CheckVelocity(entity this);
void _Movetype_CheckWaterTransition(entity ent);
void _Movetype_CheckStuck(entity this);
{
UNSET_ONGROUND(this);
_Movetype_CheckVelocity(this);
- _Movetype_FlyMove(this, dt, true, '0 0 0', 0);
+ _Movetype_FlyMove(this, dt, true, false, 0);
_Movetype_LinkEdict(this, true);
}
}
else
{
_Movetype_CheckVelocity(this);
- _Movetype_FlyMove(this, dt, true, '0 0 0', 0);
+ _Movetype_FlyMove(this, dt, true, false, 0);
_Movetype_LinkEdict(this, true);
// TODO? movetypesteplandevent
#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))
{
// 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))