From: Mario Date: Fri, 3 Mar 2017 17:09:15 +0000 (+1000) Subject: Resize the flag's hitbox depending on its scale (fixes some stupid floating flags) X-Git-Tag: xonotic-v0.8.2~151 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=0024774eac9495efc8b95612f4a89c98ddc429be;p=xonotic%2Fxonotic-data.pk3dir.git Resize the flag's hitbox depending on its scale (fixes some stupid floating flags) --- diff --git a/qcsrc/server/mutators/mutator/gamemode_ctf.qc b/qcsrc/server/mutators/mutator/gamemode_ctf.qc index 4681b0ef1..068942b0b 100644 --- a/qcsrc/server/mutators/mutator/gamemode_ctf.qc +++ b/qcsrc/server/mutators/mutator/gamemode_ctf.qc @@ -925,7 +925,7 @@ void ctf_FlagThink(entity this) LOG_TRACE("wtf the flag got squashed?"); tracebox(this.origin, CTF_FLAG.m_mins, CTF_FLAG.m_maxs, this.origin, MOVE_NOMONSTERS, this); if(!trace_startsolid || this.noalign) // can we resize it without getting stuck? - setsize(this, CTF_FLAG.m_mins, CTF_FLAG.m_maxs); + setsize(this, CTF_FLAG.m_mins * this.scale, CTF_FLAG.m_maxs * this.scale); } // main think method @@ -1317,7 +1317,7 @@ void ctf_FlagSetup(int teamnumber, entity flag) // called when spawning a flag e // appearence _setmodel(flag, flag.model); // precision set below - setsize(flag, CTF_FLAG.m_mins, CTF_FLAG.m_maxs); + setsize(flag, CTF_FLAG.m_mins * flag.scale, CTF_FLAG.m_maxs * flag.scale); setorigin(flag, (flag.origin + FLAG_SPAWN_OFFSET)); if(autocvar_g_ctf_flag_glowtrails) diff --git a/qcsrc/server/mutators/mutator/gamemode_ctf.qh b/qcsrc/server/mutators/mutator/gamemode_ctf.qh index 6dd5110fd..2c67372b4 100644 --- a/qcsrc/server/mutators/mutator/gamemode_ctf.qh +++ b/qcsrc/server/mutators/mutator/gamemode_ctf.qh @@ -10,8 +10,8 @@ void ctf_RespawnFlag(entity flag); const int ST_CTF_CAPS = 1; 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'); + ATTRIB(Flag, m_mins, vector, (PL_MIN_CONST + '0 0 -13') * 1.4); // scaling be damned + ATTRIB(Flag, m_maxs, vector, (PL_MAX_CONST + '0 0 -13') * 1.4); ENDCLASS(Flag) Flag CTF_FLAG; STATIC_INIT(Flag) { CTF_FLAG = NEW(Flag); } void ctf_FlagTouch(entity this, entity toucher) { ITEM_HANDLE(Pickup, CTF_FLAG, this, toucher); }