]> git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blob - qcsrc/common/triggers/trigger/relay_if.qc
take3: format 903 files
[xonotic/xonotic-data.pk3dir.git] / qcsrc / common / triggers / 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         int n = this.count;
6
7         // TODO make this generic AND faster than nextent() ing through all, if somehow possible
8         n = (cvar_string(this.netname) == cvar_string(this.message));
9         if (this.spawnflags & 1) {
10                 n = !n;
11         }
12
13         if (n) {
14                 SUB_UseTargets(this, actor, trigger);
15         }
16 }
17
18 spawnfunc(trigger_relay_if)
19 {
20         this.use = trigger_relay_if_use;
21 }
22 #endif