X-Git-Url: http://git.xonotic.org/?a=blobdiff_plain;f=qcsrc%2Fcommon%2Fphysics%2Fmovetypes%2Fmovetypes.qc;h=8eb2277d54ad9cd2b98c2d9dc5d2199725245c7c;hb=87390523a589c3bb63ee6826efe4a261544d7241;hp=b3f460ce7d99daaf5f6c1dab28832cbca57a5ad8;hpb=0f689f166f8b173cfe456d3446ee877b9a80bf35;p=xonotic%2Fxonotic-data.pk3dir.git diff --git a/qcsrc/common/physics/movetypes/movetypes.qc b/qcsrc/common/physics/movetypes/movetypes.qc index b3f460ce7..8eb2277d5 100644 --- a/qcsrc/common/physics/movetypes/movetypes.qc +++ b/qcsrc/common/physics/movetypes/movetypes.qc @@ -34,8 +34,10 @@ void _Movetype_WallFriction(entity this, vector stepnormal) // SV_WallFriction } 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; @@ -150,8 +152,8 @@ int _Movetype_FlyMove(entity this, float dt, bool applygravity, vector stepnorma // 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) @@ -509,10 +511,11 @@ bool _Movetype_PushEntity(entity this, vector push, bool failonstartsolid, bool { _Movetype_PushEntityTrace(this, push); + // NOTE: this is a workaround for the QC's lack of a worldstartsolid trace parameter if(trace_startsolid && failonstartsolid) { int oldtype = this.move_nomonsters; - this.move_nomonsters = MOVE_NOMONSTERS; + this.move_nomonsters = MOVE_WORLDONLY; _Movetype_PushEntityTrace(this, push); this.move_nomonsters = oldtype; if(trace_startsolid) @@ -527,7 +530,7 @@ bool _Movetype_PushEntity(entity this, vector push, bool failonstartsolid, bool _Movetype_LinkEdict(this, true); if(trace_fraction < 1) - if(this.solid >= SOLID_TRIGGER && (!IS_ONGROUND(this) || (this.groundentity != trace_ent))) + if(this.solid >= SOLID_TRIGGER && trace_ent && (!IS_ONGROUND(this) || (this.groundentity != trace_ent))) _Movetype_Impact(this, trace_ent); return (this.origin == last_origin); // false if teleported by touch