From: Mario Date: Sun, 19 Feb 2017 10:44:48 +0000 (+1000) Subject: Add a debug option to turn off the extra stuff on triggers when predicting them X-Git-Tag: xonotic-v0.8.2~196 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=1abcc79832716e25079f9c77cff0b1dcfecde14b;p=xonotic%2Fxonotic-data.pk3dir.git Add a debug option to turn off the extra stuff on triggers when predicting them --- diff --git a/qcsrc/common/triggers/triggers.qc b/qcsrc/common/triggers/triggers.qc index 1f5139896..2a76d80c4 100644 --- a/qcsrc/common/triggers/triggers.qc +++ b/qcsrc/common/triggers/triggers.qc @@ -22,22 +22,28 @@ void FixSize(entity e) #ifdef SVQC +bool autocvar_g_triggers_debug = true; + void trigger_init(entity this) { string m = this.model; EXACTTRIGGER_INIT; - if(m != "") - { - precache_model(m); - _setmodel(this, m); // no precision needed + if(autocvar_g_triggers_debug) + { + if(m != "") + { + precache_model(m); + _setmodel(this, m); // no precision needed + } + setorigin(this, this.origin); + if(this.scale) + setsize(this, this.mins * this.scale, this.maxs * this.scale); + else + setsize(this, this.mins, this.maxs); } - setorigin(this, this.origin); - if(this.scale) - setsize(this, this.mins * this.scale, this.maxs * this.scale); - else - setsize(this, this.mins, this.maxs); - BITSET_ASSIGN(this.effects, EF_NODEPTHTEST); + if(autocvar_g_triggers_debug) + BITSET_ASSIGN(this.effects, EF_NODEPTHTEST); } void trigger_link(entity this, bool(entity this, entity to, int sendflags) sendfunc)