From: Mario Date: Fri, 31 Jul 2020 09:50:35 +0000 (+1000) Subject: Ensure trigger_flipflop starts disabled upon reset, also allow flipflop triggers... X-Git-Tag: xonotic-v0.8.5~818 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=ba7cf72521f7500f3e8986cc9e95187c590eb541;p=xonotic%2Fxonotic-data.pk3dir.git Ensure trigger_flipflop starts disabled upon reset, also allow flipflop triggers to be deactivated --- diff --git a/qcsrc/common/mapobjects/trigger/flipflop.qc b/qcsrc/common/mapobjects/trigger/flipflop.qc index 141f3ea9f..84c4dd935 100644 --- a/qcsrc/common/mapobjects/trigger/flipflop.qc +++ b/qcsrc/common/mapobjects/trigger/flipflop.qc @@ -1,10 +1,14 @@ #include "flipflop.qh" + #ifdef SVQC /*QUAKED spawnfunc_trigger_flipflop (.5 .5 .5) (-8 -8 -8) (8 8 8) START_ENABLED "Flip-flop" trigger gate... lets only every second trigger event through */ void flipflop_use(entity this, entity actor, entity trigger) { + if(this.active != ACTIVE_ACTIVE) + return; + this.state = !this.state; if(this.state) SUB_UseTargets(this, actor, trigger); @@ -12,12 +16,9 @@ void flipflop_use(entity this, entity actor, entity trigger) spawnfunc(trigger_flipflop) { - if(this.spawnflags & START_ENABLED) - { - this.state = true; - } + this.active = ACTIVE_ACTIVE; + this.state = (this.spawnflags & START_ENABLED); this.use = flipflop_use; this.reset = spawnfunc_trigger_flipflop; // perfect resetter } - #endif