From c8cba34547bb620888522dc96d387f2a2068816b Mon Sep 17 00:00:00 2001 From: Mario Date: Mon, 6 Mar 2017 17:10:02 +1000 Subject: [PATCH] Fix CTF flags secretly spamming squashed messages, and fix a potential crash in client target_push code --- qcsrc/common/triggers/trigger/jumppads.qc | 6 +++--- qcsrc/server/mutators/mutator/gamemode_ctf.qc | 8 +++++--- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/qcsrc/common/triggers/trigger/jumppads.qc b/qcsrc/common/triggers/trigger/jumppads.qc index 746270877..df9650745 100644 --- a/qcsrc/common/triggers/trigger/jumppads.qc +++ b/qcsrc/common/triggers/trigger/jumppads.qc @@ -480,9 +480,9 @@ NET_HANDLE(ENT_CLIENT_TRIGGER_PUSH, bool isnew) void target_push_remove(entity this) { - if(this.classname) - strunzone(this.classname); - this.classname = string_null; + //if(this.classname) + //strunzone(this.classname); + //this.classname = string_null; if(this.targetname) strunzone(this.targetname); diff --git a/qcsrc/server/mutators/mutator/gamemode_ctf.qc b/qcsrc/server/mutators/mutator/gamemode_ctf.qc index b3270577d..b20718ef7 100644 --- a/qcsrc/server/mutators/mutator/gamemode_ctf.qc +++ b/qcsrc/server/mutators/mutator/gamemode_ctf.qc @@ -921,11 +921,11 @@ void ctf_FlagThink(entity this) FOREACH_CLIENT(true, LAMBDA(ctf_CaptureShield_Update(it, 1))); // release shield only // sanity checks - if(this.mins != CTF_FLAG.m_mins || this.maxs != CTF_FLAG.m_maxs) { // reset the flag boundaries in case it got squished + if(this.mins != this.m_mins || this.maxs != this.m_maxs) { // reset the flag boundaries in case it got squished LOG_TRACE("wtf the flag got squashed?"); - tracebox(this.origin, CTF_FLAG.m_mins, CTF_FLAG.m_maxs, this.origin, MOVE_NOMONSTERS, this); + tracebox(this.origin, this.m_mins, this.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 * this.scale, CTF_FLAG.m_maxs * this.scale); + setsize(this, this.m_mins, this.m_maxs); } // main think method @@ -1318,6 +1318,8 @@ 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 * flag.scale, CTF_FLAG.m_maxs * flag.scale); + flag.m_mins = flag.mins; // store these for squash checks + flag.m_maxs = flag.maxs; setorigin(flag, (flag.origin + FLAG_SPAWN_OFFSET)); if(autocvar_g_ctf_flag_glowtrails) -- 2.39.2