X-Git-Url: https://de.git.xonotic.org/?p=xonotic%2Fxonotic-data.pk3dir.git;a=blobdiff_plain;f=qcsrc%2Fcommon%2Ftriggers%2Ftrigger%2Fflipflop.qc;h=af212ff5a42b7449bea067a2c755d4c86374782f;hp=b5a2eb8b292d2120abe5dfc798ebd0b81b567c04;hb=59845bcb06720efc1f30ffbf550f7e04a4c51fcd;hpb=5b22584122d4354ab7819853d0fa5219d14d832e diff --git a/qcsrc/common/triggers/trigger/flipflop.qc b/qcsrc/common/triggers/trigger/flipflop.qc index b5a2eb8b2..af212ff5a 100644 --- a/qcsrc/common/triggers/trigger/flipflop.qc +++ b/qcsrc/common/triggers/trigger/flipflop.qc @@ -1,19 +1,21 @@ +#include "flipflop.qh" #ifdef SVQC /*QUAKED spawnfunc_trigger_flipflop (.5 .5 .5) (-8 -8 -8) (8 8 8) START_ENABLED "Flip-flop" trigger gate... lets only every second trigger event through */ -void flipflop_use() -{SELFPARAM(); - self.state = !self.state; - if(self.state) - SUB_UseTargets(); +void flipflop_use(entity this, entity actor, entity trigger) +{ + this.state = !this.state; + if(this.state) + SUB_UseTargets(this, actor, trigger); } -void spawnfunc_trigger_flipflop() -{SELFPARAM(); - if(self.spawnflags & 1) - self.state = 1; - self.use = flipflop_use; - self.reset = spawnfunc_trigger_flipflop; // perfect resetter +spawnfunc(trigger_flipflop) +{ + if(this.spawnflags & 1) + this.state = 1; + this.use = flipflop_use; + this.reset = spawnfunc_trigger_flipflop; // perfect resetter } + #endif