]> git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/common/triggers/trigger/multivibrator.qc
Remove a few more magic numbers and minor code cleanup
[xonotic/xonotic-data.pk3dir.git] / qcsrc / common / triggers / trigger / multivibrator.qc
index 2c17fbb0d1e9cbb339ac5cc5be388d40d88d3471..932fda13ca94a5984f9e4d286848430147575158 100644 (file)
@@ -1,3 +1,4 @@
+#include "multivibrator.qh"
 #ifdef SVQC
 void multivibrator_send(entity this)
 {
@@ -18,8 +19,8 @@ void multivibrator_send(entity this)
                this.nextthink = cyclestart + this.wait + this.respawntime + 0.01;
 }
 
-void multivibrator_send_think()
-{SELFPARAM();
+void multivibrator_send_think(entity this)
+{
        multivibrator_send(this);
 }
 
@@ -42,13 +43,13 @@ void multivibrator_toggle(entity this, entity actor, entity trigger)
 
 void multivibrator_reset(entity this)
 {
-       if(!(this.spawnflags & 1))
+       if(!(this.spawnflags & START_ENABLED))
                this.nextthink = 0; // wait for a trigger event
        else
                this.nextthink = max(1, time);
 }
 
-/*QUAKED trigger_multivibrator (.5 .5 .5) (-8 -8 -8) (8 8 8) START_ON
+/*QUAKED trigger_multivibrator (.5 .5 .5) (-8 -8 -8) (8 8 8) START_ENABLED
 "Multivibrator" trigger gate... repeatedly sends trigger events. When triggered, turns on or off.
 -------- KEYS --------
 target: trigger all entities with this targetname when it goes off
@@ -57,7 +58,7 @@ phase: offset of the timing
 wait: "on" cycle time (default: 1)
 respawntime: "off" cycle time (default: same as wait)
 -------- SPAWNFLAGS --------
-START_ON: assume it is already turned on (when targeted)
+START_ENABLED: assume it is already turned on (when targeted)
 */
 spawnfunc(trigger_multivibrator)
 {