From ba7cf72521f7500f3e8986cc9e95187c590eb541 Mon Sep 17 00:00:00 2001 From: Mario Date: Fri, 31 Jul 2020 19:50:35 +1000 Subject: [PATCH] Ensure trigger_flipflop starts disabled upon reset, also allow flipflop triggers to be deactivated --- qcsrc/common/mapobjects/trigger/flipflop.qc | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) 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 -- 2.39.2