From: Mario Date: Wed, 28 Jun 2017 01:24:22 +0000 (+1000) Subject: Remove some seemingly useless includes from the movetype code, making it partially... X-Git-Tag: xonotic-v0.8.5~2677 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=c7e14f11918ab2d6a93d781f253addb756c08665;p=xonotic%2Fxonotic-data.pk3dir.git Remove some seemingly useless includes from the movetype code, making it partially self-contained --- diff --git a/qcsrc/common/physics/movetypes/movetypes.qc b/qcsrc/common/physics/movetypes/movetypes.qc index 407a703cf..995c65b4d 100644 --- a/qcsrc/common/physics/movetypes/movetypes.qc +++ b/qcsrc/common/physics/movetypes/movetypes.qc @@ -1,16 +1,4 @@ #include "movetypes.qh" -#include "../player.qh" - -#if defined(CSQC) - #include - #include - #include - #include - #include -#elif defined(MENUQC) -#elif defined(SVQC) - #include -#endif #ifdef SVQC void set_movetype(entity this, int mt) @@ -48,7 +36,7 @@ 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 blocked = 0, bumpcount; + int blocked = 0; int i, j, numplanes = 0; float time_left = dt, grav = 0; vector push; @@ -73,7 +61,7 @@ int _Movetype_FlyMove(entity this, float dt, bool applygravity, vector stepnorma original_velocity = primal_velocity = restore_velocity = this.velocity; - for(bumpcount = 0;bumpcount < MAX_CLIP_PLANES;bumpcount++) + for(int bumpcount = 0;bumpcount < MAX_CLIP_PLANES;bumpcount++) { if(this.velocity == '0 0 0') break; @@ -138,7 +126,7 @@ int _Movetype_FlyMove(entity this, float dt, bool applygravity, vector stepnorma break; } float trace2_fraction = trace_fraction; - steppush = '0 0 1' * (org_z - this.origin_z); + steppush = '0 0 1' * (org.z - this.origin_z); _Movetype_PushEntity(this, steppush, true); if(trace_startsolid) { @@ -147,7 +135,7 @@ int _Movetype_FlyMove(entity this, float dt, bool applygravity, vector stepnorma } // accept the new position if it made some progress... - if(fabs(this.origin_x - org_x) >= 0.03125 || fabs(this.origin_y - org_y) >= 0.03125) + if(fabs(this.origin_x - org.x) >= 0.03125 || fabs(this.origin_y - org.y) >= 0.03125) { trace_endpos = this.origin; time_left *= 1 - trace2_fraction; diff --git a/qcsrc/common/physics/movetypes/movetypes.qh b/qcsrc/common/physics/movetypes/movetypes.qh index d26de7b96..712817386 100644 --- a/qcsrc/common/physics/movetypes/movetypes.qh +++ b/qcsrc/common/physics/movetypes/movetypes.qh @@ -7,6 +7,13 @@ #define SET_ONSLICK(s) ((s).flags |= FL_ONSLICK) #define UNSET_ONSLICK(s) ((s).flags &= ~FL_ONSLICK) +#define GAMEPLAYFIX_DOWNTRACEONGROUND(s) STAT(GAMEPLAYFIX_DOWNTRACEONGROUND, s) +#define GAMEPLAYFIX_EASIERWATERJUMP(s) STAT(GAMEPLAYFIX_EASIERWATERJUMP, s) +#define GAMEPLAYFIX_STEPDOWN(s) STAT(GAMEPLAYFIX_STEPDOWN, s) +#define GAMEPLAYFIX_STEPMULTIPLETIMES(s) STAT(GAMEPLAYFIX_STEPMULTIPLETIMES, s) +#define GAMEPLAYFIX_UNSTICKPLAYERS(s) STAT(GAMEPLAYFIX_UNSTICKPLAYERS, s) +#define GAMEPLAYFIX_WATERTRANSITION(s) STAT(GAMEPLAYFIX_WATERTRANSITION, s) + #ifdef CSQC .float bouncestop; .float bouncefactor; diff --git a/qcsrc/common/physics/movetypes/toss.qc b/qcsrc/common/physics/movetypes/toss.qc index 498852135..71e7fa9d0 100644 --- a/qcsrc/common/physics/movetypes/toss.qc +++ b/qcsrc/common/physics/movetypes/toss.qc @@ -1,5 +1,4 @@ #include "toss.qh" -#include "../player.qh" void _Movetype_Physics_Toss(entity this, float dt) // SV_Physics_Toss { diff --git a/qcsrc/common/physics/player.qh b/qcsrc/common/physics/player.qh index 571d3c6cb..0a9008b4e 100644 --- a/qcsrc/common/physics/player.qh +++ b/qcsrc/common/physics/player.qh @@ -31,13 +31,6 @@ bool IsFlying(entity a); #define BUFFS_STAT(s) STAT(BUFFS, s) -#define GAMEPLAYFIX_DOWNTRACEONGROUND(s) STAT(GAMEPLAYFIX_DOWNTRACEONGROUND, s) -#define GAMEPLAYFIX_EASIERWATERJUMP(s) STAT(GAMEPLAYFIX_EASIERWATERJUMP, s) -#define GAMEPLAYFIX_STEPDOWN(s) STAT(GAMEPLAYFIX_STEPDOWN, s) -#define GAMEPLAYFIX_STEPMULTIPLETIMES(s) STAT(GAMEPLAYFIX_STEPMULTIPLETIMES, s) -#define GAMEPLAYFIX_UNSTICKPLAYERS(s) STAT(GAMEPLAYFIX_UNSTICKPLAYERS, s) -#define GAMEPLAYFIX_WATERTRANSITION(s) STAT(GAMEPLAYFIX_WATERTRANSITION, s) - #define PHYS_ACCELERATE(s) STAT(MOVEVARS_ACCELERATE, s) #define PHYS_AIRACCELERATE(s) STAT(MOVEVARS_AIRACCELERATE, s) #define PHYS_AIRACCEL_QW(s) STAT(MOVEVARS_AIRACCEL_QW, s)