]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blob - qcsrc/common/mapobjects/trigger/relay_if.qc
Merge branch 'garymoon/show-server-name-in-info' into 'master'
[xonotic/xonotic-data.pk3dir.git] / qcsrc / common / mapobjects / trigger / relay_if.qc
1 #include "relay_if.qh"
2 #ifdef SVQC
3 void trigger_relay_if_use(entity this, entity actor, entity trigger)
4 {
5         if(this.active != ACTIVE_ACTIVE)
6                 return;
7
8         int n = this.count;
9
10         // TODO make this generic AND faster than nextent()ing through all, if somehow possible
11         n = (cvar_string(this.netname) == cvar_string(this.message));
12         if(this.spawnflags & RELAYIF_NEGATE)
13                 n = !n;
14
15         if(n)
16                 SUB_UseTargets(this, actor, trigger);
17 }
18
19 spawnfunc(trigger_relay_if)
20 {
21         this.reset = spawnfunc_trigger_relay_if; // this spawnfunc resets fully
22         this.active = ACTIVE_ACTIVE;
23         this.use = trigger_relay_if_use;
24 }
25 #endif