X-Git-Url: http://de.git.xonotic.org/?a=blobdiff_plain;f=qcsrc%2Fcommon%2Ftriggers%2Ftrigger%2Fmonoflop.qc;h=4c0e27c7563769bbe94a0313bbce3b3226e3231e;hb=a07691e754aa071189c034693af3476777d86720;hp=5129ce35cdf11d20dfd2b567ca2b6f1efbb9d26c;hpb=8da45596c76bb645e864b4ec8ff5a3ee13bbf27c;p=xonotic%2Fxonotic-data.pk3dir.git diff --git a/qcsrc/common/triggers/trigger/monoflop.qc b/qcsrc/common/triggers/trigger/monoflop.qc index 5129ce35c..4c0e27c75 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() -{SELFPARAM(); - self.nextthink = time + self.wait; - self.enemy = activator; - if(self.state) +void monoflop_use(entity this, entity actor, entity trigger) +{ + 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() -{SELFPARAM(); - if(self.state) +void monoflop_fixed_use(entity this, entity actor, entity trigger) +{ + 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() {SELFPARAM(); - self.state = 0; - activator = self.enemy; - SUB_UseTargets(); + this.state = 0; + SUB_UseTargets(this, this.enemy, NULL); } -void monoflop_reset() -{SELFPARAM(); - self.state = 0; - self.nextthink = 0; +void monoflop_reset(entity this) +{ + this.state = 0; + this.nextthink = 0; } -void spawnfunc_trigger_monoflop() -{SELFPARAM(); - if(!self.wait) - self.wait = 1; - if(self.spawnflags & 1) - self.use = monoflop_fixed_use; +spawnfunc(trigger_monoflop) +{ + if(!this.wait) + this.wait = 1; + if(this.spawnflags & 1) + this.use1 = monoflop_fixed_use; else - self.use = monoflop_use; - self.think = monoflop_think; - self.state = 0; - self.reset = monoflop_reset; + this.use1 = monoflop_use; + this.think = monoflop_think; + this.state = 0; + this.reset = monoflop_reset; } #endif