]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blob - qcsrc/common/mapobjects/trigger/relay_teamcheck.qc
Merge branch 'master' into Mario/speed_var
[xonotic/xonotic-data.pk3dir.git] / qcsrc / common / mapobjects / trigger / relay_teamcheck.qc
1 #include "relay_teamcheck.qh"
2 #ifdef SVQC
3 void trigger_relay_teamcheck_use(entity this, entity actor, entity trigger)
4 {
5         if(this.active != ACTIVE_ACTIVE)
6                 return;
7
8         if(actor.team)
9         {
10                 if(this.spawnflags & RELAYTEAMCHECK_INVERT)
11                 {
12                         if(DIFF_TEAM(actor, this))
13                                 SUB_UseTargets(this, actor, trigger);
14                 }
15                 else
16                 {
17                         if(SAME_TEAM(actor, this))
18                                 SUB_UseTargets(this, actor, trigger);
19                 }
20         }
21         else
22         {
23                 if(this.spawnflags & RELAYTEAMCHECK_NOTEAM)
24                         SUB_UseTargets(this, actor, trigger);
25         }
26 }
27
28 void trigger_relay_teamcheck_reset(entity this)
29 {
30         this.active = ACTIVE_ACTIVE;
31         this.team = this.team_saved;
32 }
33
34 spawnfunc(trigger_relay_teamcheck)
35 {
36         this.active = ACTIVE_ACTIVE;
37         this.team_saved = this.team;
38         IL_PUSH(g_saved_team, this);
39         this.use = trigger_relay_teamcheck_use;
40         this.reset = trigger_relay_teamcheck_reset;
41 }
42 #endif