]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blob - qcsrc/common/triggers/trigger/flipflop.qc
Properly support team field on trigger_multiple
[xonotic/xonotic-data.pk3dir.git] / qcsrc / common / triggers / trigger / flipflop.qc
1 #include "flipflop.qh"
2 #ifdef SVQC
3 /*QUAKED spawnfunc_trigger_flipflop (.5 .5 .5) (-8 -8 -8) (8 8 8) START_ENABLED
4 "Flip-flop" trigger gate... lets only every second trigger event through
5 */
6 void flipflop_use(entity this, entity actor, entity trigger)
7 {
8     this.state = !this.state;
9     if(this.state)
10         SUB_UseTargets(this, actor, trigger);
11 }
12
13 spawnfunc(trigger_flipflop)
14 {
15     if(this.spawnflags & 1)
16         this.state = 1;
17     this.use = flipflop_use;
18     this.reset = spawnfunc_trigger_flipflop; // perfect resetter
19 }
20
21 #endif