X-Git-Url: http://de.git.xonotic.org/?a=blobdiff_plain;f=qcsrc%2Fcommon%2Ftriggers%2Ftrigger%2Fmonoflop.qc;h=994d498c11e8b0a43056979fccd29ee5430542e7;hb=847371860eeb17f6a51aa1fa532aa997cb2d760b;hp=45ce761e035d85a5b344828e26170458b1b514c5;hpb=1d4454eb627b54e4b01a36ccce32a2767b02416c;p=xonotic%2Fxonotic-data.pk3dir.git diff --git a/qcsrc/common/triggers/trigger/monoflop.qc b/qcsrc/common/triggers/trigger/monoflop.qc index 45ce761e0..994d498c1 100644 --- a/qcsrc/common/triggers/trigger/monoflop.qc +++ b/qcsrc/common/triggers/trigger/monoflop.qc @@ -2,48 +2,47 @@ /*QUAKED spawnfunc_trigger_monoflop (.5 .5 .5) (-8 -8 -8) (8 8 8) "Mono-flop" trigger gate... turns one trigger event into one "on" and one "off" event, separated by a delay of "wait" */ -void monoflop_use() +void monoflop_use(entity this, entity actor, entity trigger) { - self.nextthink = time + self.wait; - self.enemy = activator; - if(self.state) + this.nextthink = time + this.wait; + this.enemy = actor; + if(this.state) return; - self.state = 1; - SUB_UseTargets(); + this.state = 1; + SUB_UseTargets(this, actor, trigger); } -void monoflop_fixed_use() +void monoflop_fixed_use(entity this, entity actor, entity trigger) { - if(self.state) + if(this.state) return; - self.nextthink = time + self.wait; - self.state = 1; - self.enemy = activator; - SUB_UseTargets(); + this.nextthink = time + this.wait; + this.state = 1; + this.enemy = actor; + SUB_UseTargets(this, actor, trigger); } void monoflop_think() -{ - self.state = 0; - activator = self.enemy; - SUB_UseTargets(); +{SELFPARAM(); + this.state = 0; + SUB_UseTargets(this, this.enemy, NULL); } -void monoflop_reset() +void monoflop_reset(entity this) { - self.state = 0; - self.nextthink = 0; + this.state = 0; + this.nextthink = 0; } -void spawnfunc_trigger_monoflop() +spawnfunc(trigger_monoflop) { - if(!self.wait) - self.wait = 1; - if(self.spawnflags & 1) - self.use = monoflop_fixed_use; + if(!this.wait) + this.wait = 1; + if(this.spawnflags & 1) + this.use = monoflop_fixed_use; else - self.use = monoflop_use; - self.think = monoflop_think; - self.state = 0; - self.reset = monoflop_reset; + this.use = monoflop_use; + this.think = monoflop_think; + this.state = 0; + this.reset = monoflop_reset; } #endif