From: Mario Date: Fri, 29 Jul 2016 23:14:56 +0000 (+1000) Subject: Use .groundentity (compatibility with engine) X-Git-Tag: xonotic-v0.8.2~700^2~5 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=3d52c1d33d80f8789bfbd97ee54e292ca06b5a9e;p=xonotic%2Fxonotic-data.pk3dir.git Use .groundentity (compatibility with engine) --- diff --git a/qcsrc/common/physics/movetypes/movetypes.qc b/qcsrc/common/physics/movetypes/movetypes.qc index ccdf2e703..090144dd1 100644 --- a/qcsrc/common/physics/movetypes/movetypes.qc +++ b/qcsrc/common/physics/movetypes/movetypes.qc @@ -122,7 +122,7 @@ int _Movetype_FlyMove(entity this, float dt, bool applygravity, vector stepnorma } SET_ONGROUND(this); - this.move_groundentity = trace_ent; + this.groundentity = trace_ent; } } else if(stepheight) @@ -502,7 +502,7 @@ float _Movetype_PushEntity(entity this, vector push, bool failonstartsolid) // this.origin = trace_endpos; if(trace_fraction < 1) - if(this.solid >= SOLID_TRIGGER && (!IS_ONGROUND(this) || (this.move_groundentity != trace_ent))) + if(this.solid >= SOLID_TRIGGER && (!IS_ONGROUND(this) || (this.groundentity != trace_ent))) _Movetype_Impact(this, trace_ent); return trace_fraction; diff --git a/qcsrc/common/physics/movetypes/movetypes.qh b/qcsrc/common/physics/movetypes/movetypes.qh index cd0f09c21..6b75d81c0 100644 --- a/qcsrc/common/physics/movetypes/movetypes.qh +++ b/qcsrc/common/physics/movetypes/movetypes.qh @@ -33,7 +33,7 @@ void set_movetype(entity this, int mt); .entity aiment; .vector punchangle; -.entity move_groundentity; // FIXME add move_groundnetworkentity? +.entity groundentity; // FIXME add move_groundnetworkentity? .float move_suspendedinair; .float move_didgravity; @@ -79,6 +79,9 @@ const int MOVETYPE_FLY_WORLDONLY = 33; const int FL_ITEM = 256; const int FL_ONGROUND = 512; +#elif defined(SVQC) +const int MOVETYPE_ANGLENOCLIP = 1; +const int MOVETYPE_ANGLECLIP = 2; #endif const int MOVETYPE_FAKEPUSH = 13; diff --git a/qcsrc/common/physics/movetypes/toss.qc b/qcsrc/common/physics/movetypes/toss.qc index db3ff72da..4821e34f6 100644 --- a/qcsrc/common/physics/movetypes/toss.qc +++ b/qcsrc/common/physics/movetypes/toss.qc @@ -8,13 +8,13 @@ void _Movetype_Physics_Toss(entity this, float dt) // SV_Physics_Toss { UNSET_ONGROUND(this); } - else if (!this.move_groundentity) + else if (!this.groundentity) { return; } - else if (this.move_suspendedinair && wasfreed(this.move_groundentity)) + else if (this.move_suspendedinair && wasfreed(this.groundentity)) { - this.move_groundentity = NULL; + this.groundentity = NULL; return; } } @@ -78,7 +78,7 @@ void _Movetype_Physics_Toss(entity this, float dt) // SV_Physics_Toss if (trace_plane_normal.z > 0.7 && d < bstop && d > -bstop) { SET_ONGROUND(this); - this.move_groundentity = trace_ent; + this.groundentity = trace_ent; this.velocity = '0 0 0'; this.avelocity = '0 0 0'; } @@ -93,7 +93,7 @@ void _Movetype_Physics_Toss(entity this, float dt) // SV_Physics_Toss if (trace_plane_normal.z > 0.7) { SET_ONGROUND(this); - this.move_groundentity = trace_ent; + this.groundentity = trace_ent; if (trace_ent.solid == SOLID_BSP) this.move_suspendedinair = true; this.velocity = '0 0 0'; diff --git a/qcsrc/common/physics/movetypes/walk.qc b/qcsrc/common/physics/movetypes/walk.qc index 45b1dc39c..bf58ca582 100644 --- a/qcsrc/common/physics/movetypes/walk.qc +++ b/qcsrc/common/physics/movetypes/walk.qc @@ -61,7 +61,7 @@ void _Movetype_Physics_Walk(entity this, float dt) // SV_WalkMove vector originalvelocity = this.velocity; // originalmove_clip = clip; int originalflags = this.flags; - entity originalmove_groundentity = this.move_groundentity; + entity originalmove_groundentity = this.groundentity; // if move didn't block on a step, return if (clip & 2) @@ -124,7 +124,7 @@ void _Movetype_Physics_Walk(entity this, float dt) // SV_WalkMove this.velocity = originalvelocity; // clip = originalmove_clip; this.flags = originalflags; - this.move_groundentity = originalmove_groundentity; + this.groundentity = originalmove_groundentity; // now try to unstick if needed // clip = SV_TryUnstick (ent, oldvel); return; @@ -168,7 +168,7 @@ void _Movetype_Physics_Walk(entity this, float dt) // SV_WalkMove this.origin = originalorigin; this.velocity = originalvelocity; this.flags = originalflags; - this.move_groundentity = originalmove_groundentity; + this.groundentity = originalmove_groundentity; } _Movetype_CheckVelocity(this);