]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blob - qcsrc/common/mapobjects/trigger/disablerelay.qc
Make so that g_waypointsprite_team_here_p's trace hits map items, matching item detec...
[xonotic/xonotic-data.pk3dir.git] / qcsrc / common / mapobjects / trigger / disablerelay.qc
1 #include "disablerelay.qh"
2 #ifdef SVQC
3 void trigger_disablerelay_use(entity this, entity actor, entity trigger)
4 {
5         int a = 0, b = 0;
6
7         for(entity e = NULL; (e = find(e, targetname, this.target)); )
8         {
9                 if(e.use == SUB_UseTargets)
10                 {
11                         e.use = SUB_DontUseTargets;
12                         ++a;
13                 }
14                 else if(e.use == SUB_DontUseTargets)
15                 {
16                         e.use = SUB_UseTargets;
17                         ++b;
18                 }
19         }
20
21         if((!a) == (!b))
22                 LOG_INFO("Invalid use of trigger_disablerelay: ", ftos(a), " relays were on, ", ftos(b), " relays were off!");
23 }
24
25 spawnfunc(trigger_disablerelay)
26 {
27         this.use = trigger_disablerelay_use;
28 }
29 #endif