From: bones_was_here Date: Fri, 3 Feb 2023 03:00:05 +0000 (+1000) Subject: Remove trigger_init(), it's in the way and is mostly duplicating WarpZoneLib_ExactTri... X-Git-Tag: xonotic-v0.8.6~93^2~5 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=2b46f62db61e8ca869fc591d9ebe4053c3e876d7;p=xonotic%2Fxonotic-data.pk3dir.git Remove trigger_init(), it's in the way and is mostly duplicating WarpZoneLib_ExactTrigger_Init() code --- diff --git a/qcsrc/common/mapobjects/func/ladder.qc b/qcsrc/common/mapobjects/func/ladder.qc index 36f802f4a..0d4e253f0 100644 --- a/qcsrc/common/mapobjects/func/ladder.qc +++ b/qcsrc/common/mapobjects/func/ladder.qc @@ -64,7 +64,8 @@ void func_ladder_link(entity this) void func_ladder_init(entity this) { - trigger_init(this); + EXACTTRIGGER_INIT; + BITSET_ASSIGN(this.effects, EF_NODEPTHTEST); func_ladder_link(this); setthink(this, func_ladder_think); this.nextthink = time; diff --git a/qcsrc/common/mapobjects/trigger/impulse.qc b/qcsrc/common/mapobjects/trigger/impulse.qc index 4306e2ff7..8cafdfa38 100644 --- a/qcsrc/common/mapobjects/trigger/impulse.qc +++ b/qcsrc/common/mapobjects/trigger/impulse.qc @@ -174,8 +174,8 @@ void trigger_impulse_link(entity this) spawnfunc(trigger_impulse) { this.active = ACTIVE_ACTIVE; - - trigger_init(this); + EXACTTRIGGER_INIT; + BITSET_ASSIGN(this.effects, EF_NODEPTHTEST); if(this.radius) { diff --git a/qcsrc/common/mapobjects/trigger/jumppads.qc b/qcsrc/common/mapobjects/trigger/jumppads.qc index 4754213bf..0ff3ba0a9 100644 --- a/qcsrc/common/mapobjects/trigger/jumppads.qc +++ b/qcsrc/common/mapobjects/trigger/jumppads.qc @@ -606,8 +606,8 @@ spawnfunc(trigger_push) { SetMovedir(this); - trigger_init(this); - + EXACTTRIGGER_INIT; + BITSET_ASSIGN(this.effects, EF_NODEPTHTEST); this.active = ACTIVE_ACTIVE; this.use = trigger_push_use; settouch(this, trigger_push_touch); diff --git a/qcsrc/common/mapobjects/trigger/swamp.qc b/qcsrc/common/mapobjects/trigger/swamp.qc index 3aa6134a9..a54665962 100644 --- a/qcsrc/common/mapobjects/trigger/swamp.qc +++ b/qcsrc/common/mapobjects/trigger/swamp.qc @@ -69,7 +69,6 @@ spawnfunc(trigger_swamp) // Init stuff EXACTTRIGGER_INIT; this.active = ACTIVE_ACTIVE; - //trigger_init(this); setthink(this, swamp_think); this.nextthink = time; diff --git a/qcsrc/common/mapobjects/trigger/teleport.qc b/qcsrc/common/mapobjects/trigger/teleport.qc index 0ac4559cc..b581db061 100644 --- a/qcsrc/common/mapobjects/trigger/teleport.qc +++ b/qcsrc/common/mapobjects/trigger/teleport.qc @@ -122,7 +122,6 @@ spawnfunc(trigger_teleport) this.angles = '0 0 0'; this.active = ACTIVE_ACTIVE; - //trigger_init(this); // only for predicted triggers? EXACTTRIGGER_INIT; this.use = trigger_teleport_use; diff --git a/qcsrc/common/mapobjects/triggers.qc b/qcsrc/common/mapobjects/triggers.qc index 39fa89c42..0f0f7f788 100644 --- a/qcsrc/common/mapobjects/triggers.qc +++ b/qcsrc/common/mapobjects/triggers.qc @@ -101,30 +101,6 @@ void generic_netlinked_legacy_use(entity this, entity actor, entity trigger) this.setactive(this, ACTIVE_TOGGLE); } -bool autocvar_g_triggers_debug = true; - -void trigger_init(entity this) -{ - string m = this.model; - EXACTTRIGGER_INIT; - 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); - } - - if(autocvar_g_triggers_debug) - BITSET_ASSIGN(this.effects, EF_NODEPTHTEST); -} - void trigger_link(entity this, bool(entity this, entity to, int sendflags) sendfunc) { setSendEntity(this, sendfunc);