]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blob - qcsrc/common/triggers/trigger/relay_teamcheck.qc
Merge branch 'master' into terencehill/spectatee_status_update
[xonotic/xonotic-data.pk3dir.git] / qcsrc / common / triggers / 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(actor.team)
6         {
7                 if(this.spawnflags & 2)
8                 {
9                         if(DIFF_TEAM(actor, this))
10                                 SUB_UseTargets(this, actor, trigger);
11                 }
12                 else
13                 {
14                         if(SAME_TEAM(actor, this))
15                                 SUB_UseTargets(this, actor, trigger);
16                 }
17         }
18         else
19         {
20                 if(this.spawnflags & 1)
21                         SUB_UseTargets(this, actor, trigger);
22         }
23 }
24
25 void trigger_relay_teamcheck_reset(entity this)
26 {
27         this.team = this.team_saved;
28 }
29
30 spawnfunc(trigger_relay_teamcheck)
31 {
32         this.team_saved = this.team;
33         this.use = trigger_relay_teamcheck_use;
34         this.reset = trigger_relay_teamcheck_reset;
35 }
36 #endif