// move up
vector upmove = '0 0 1' * PHYS_STEPHEIGHT;
- if (!_Movetype_PushEntity(upmove, true))
+ vector prev_origin = self.move_origin;
+ _Movetype_PushEntity(upmove, true);
+ if(wasfreed(self))
+ return;
+ if(trace_startsolid && self.move_origin != prev_origin)
{
// we got teleported when upstepping... must abort the move
return;
// Con_Printf("step - ");
// extra friction based on view angle
- if (clip & 2 && PHYS_WALLFRICTION)
+ if ((clip & 2) && PHYS_WALLFRICTION)
_Movetype_WallFriction(stepnormal);
}
// don't do the down move if stepdown is disabled, moving upward, not in water, or the move started offground or ended onground
// move down
vector downmove = '0 0 1' * (-PHYS_STEPHEIGHT + start_velocity.z * dt);
- if (!_Movetype_PushEntity(downmove, true))
+ vector prev_origin = self.move_origin;
+ _Movetype_PushEntity(downmove, true);
+ if(wasfreed(self))
+ return;
+
+ if(trace_startsolid && self.move_origin != prev_origin)
{
// we got teleported when downstepping... must abort the move
return;