#ifdef SVQC
void multivibrator_send()
-{
+{SELFPARAM();
float newstate;
float cyclestart;
newstate = (time < cyclestart + self.wait);
- activator = self;
if(self.state != newstate)
- SUB_UseTargets();
+ SUB_UseTargets(self, self, NULL);
self.state = newstate;
if(self.state)
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
-------- SPAWNFLAGS --------
START_ON: assume it is already turned on (when targeted)
*/
-void spawnfunc_trigger_multivibrator()
+spawnfunc(trigger_multivibrator)
{
if(!self.wait)
self.wait = 1;