]> git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/common/mapobjects/trigger/flipflop.qc
Merge branch 'master' into Lyberta/WaypointIcons
[xonotic/xonotic-data.pk3dir.git] / qcsrc / common / mapobjects / trigger / flipflop.qc
index 141f3ea9f19e513dcad6aeaa07e304efaec9dea8..84c4dd9357af639dd482b7d9a66a4bd55aefb560 100644 (file)
@@ -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