From: TimePath Date: Wed, 14 Oct 2015 01:08:09 +0000 (+1100) Subject: CTF: flag size in flag class X-Git-Tag: xonotic-v0.8.2~1760^2~3 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=787cb6767545b9ceef2dfb368cb8d6c587fbe0cc;p=xonotic%2Fxonotic-data.pk3dir.git CTF: flag size in flag class --- diff --git a/qcsrc/server/mutators/gamemode_ctf.qc b/qcsrc/server/mutators/gamemode_ctf.qc index 39b090c18..e8722af8d 100644 --- a/qcsrc/server/mutators/gamemode_ctf.qc +++ b/qcsrc/server/mutators/gamemode_ctf.qc @@ -766,11 +766,11 @@ void ctf_FlagThink() ctf_CaptureShield_Update(tmp_entity, 1); // release shield only // sanity checks - if(self.mins != FLAG_MIN || self.maxs != FLAG_MAX) { // reset the flag boundaries in case it got squished + if(self.mins != CTF_FLAG.m_mins || self.maxs != CTF_FLAG.m_maxs) { // reset the flag boundaries in case it got squished LOG_TRACE("wtf the flag got squashed?\n"); - tracebox(self.origin, FLAG_MIN, FLAG_MAX, self.origin, MOVE_NOMONSTERS, self); + tracebox(self.origin, CTF_FLAG.m_mins, CTF_FLAG.m_maxs, self.origin, MOVE_NOMONSTERS, self); if(!trace_startsolid || self.noalign) // can we resize it without getting stuck? - setsize(self, FLAG_MIN, FLAG_MAX); } + setsize(self, CTF_FLAG.m_mins, CTF_FLAG.m_maxs); } switch(self.ctf_status) // reset flag angles in case warpzones adjust it { @@ -901,10 +901,6 @@ void ctf_FlagThink() } } -CLASS(Flag, Pickup) -ENDCLASS(Flag) -Flag CTF_FLAG; STATIC_INIT(Flag) { CTF_FLAG = NEW(Flag); } -void ctf_FlagTouch() { SELFPARAM(); ITEM_HANDLE(Pickup, CTF_FLAG, this, other); } METHOD(Flag, giveTo, bool(Flag this, entity flag, entity toucher)) { return = false; @@ -1154,7 +1150,7 @@ void ctf_FlagSetup(int teamnumber, entity flag) // called when spawning a flag e // appearence _setmodel(flag, flag.model); // precision set below - setsize(flag, FLAG_MIN, FLAG_MAX); + setsize(flag, CTF_FLAG.m_mins, CTF_FLAG.m_maxs); setorigin(flag, (flag.origin + FLAG_SPAWN_OFFSET)); if(autocvar_g_ctf_flag_glowtrails) diff --git a/qcsrc/server/mutators/gamemode_ctf.qh b/qcsrc/server/mutators/gamemode_ctf.qh index b5ff1774a..7c87de5a3 100644 --- a/qcsrc/server/mutators/gamemode_ctf.qh +++ b/qcsrc/server/mutators/gamemode_ctf.qh @@ -15,9 +15,14 @@ const int SP_CTF_DROPS = 7; const int SP_CTF_FCKILLS = 8; const int SP_CTF_RETURNS = 9; +CLASS(Flag, Pickup) + ATTRIB(Flag, m_mins, vector, PL_MIN_CONST + '0 0 -13') + ATTRIB(Flag, m_maxs, vector, PL_MAX_CONST + '0 0 -13') +ENDCLASS(Flag) +Flag CTF_FLAG; STATIC_INIT(Flag) { CTF_FLAG = NEW(Flag); } +void ctf_FlagTouch() { SELFPARAM(); ITEM_HANDLE(Pickup, CTF_FLAG, this, other); } + // flag constants // for most of these, there is just one question to be asked: WHYYYYY? -#define FLAG_MIN (PL_MIN_CONST + '0 0 -13') -#define FLAG_MAX (PL_MAX_CONST + '0 0 -13') const float FLAG_SCALE = 0.6;