]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/common/triggers/trigger/multivibrator.qc
Merge branch 'master' into Mirio/balance
[xonotic/xonotic-data.pk3dir.git] / qcsrc / common / triggers / trigger / multivibrator.qc
index 02a258e87f13a92a942f70f5c2427129f4457928..a50f62b7abd699f207746792a1693f7a07dd9c26 100644 (file)
@@ -1,6 +1,6 @@
 #ifdef SVQC
 void multivibrator_send()
-{
+{SELFPARAM();
        float newstate;
        float cyclestart;
 
@@ -8,9 +8,8 @@ void multivibrator_send()
 
        newstate = (time < cyclestart + self.wait);
 
-       activator = self;
        if(self.state != newstate)
-               SUB_UseTargets();
+               SUB_UseTargets(self, self, NULL);
        self.state = newstate;
 
        if(self.state)
@@ -19,25 +18,25 @@ void multivibrator_send()
                self.nextthink = cyclestart + self.wait + self.respawntime + 0.01;
 }
 
-void multivibrator_toggle()
+void multivibrator_toggle(entity this, entity actor, entity trigger)
 {
-       if(self.nextthink == 0)
+       if(this.nextthink == 0)
        {
-               multivibrator_send();
+               WITHSELF(this, multivibrator_send());
        }
        else
        {
-               if(self.state)
+               if(this.state)
                {
-                       SUB_UseTargets();
-                       self.state = 0;
+                       SUB_UseTargets(this, actor, trigger);
+                       this.state = 0;
                }
-               self.nextthink = 0;
+               this.nextthink = 0;
        }
 }
 
 void multivibrator_reset()
-{
+{SELFPARAM();
        if(!(self.spawnflags & 1))
                self.nextthink = 0; // wait for a trigger event
        else
@@ -55,7 +54,7 @@ respawntime: "off" cycle time (default: same as wait)
 -------- SPAWNFLAGS --------
 START_ON: assume it is already turned on (when targeted)
 */
-void spawnfunc_trigger_multivibrator()
+spawnfunc(trigger_multivibrator)
 {
        if(!self.wait)
                self.wait = 1;