]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blob - qcsrc/common/mapobjects/trigger/flipflop.qc
Merge branch 'master' into Mario/stats_eloranking
[xonotic/xonotic-data.pk3dir.git] / qcsrc / common / mapobjects / 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 & START_ENABLED)
16     {
17         this.state = true;
18     }
19     this.use = flipflop_use;
20     this.reset = spawnfunc_trigger_flipflop; // perfect resetter
21 }
22
23 #endif