Merge branch 'master' into Mario/vaporizer_damage
[xonotic/xonotic-data.pk3dir.git] / qcsrc / common / triggers / trigger / relay_teamcheck.qc
1 #ifdef SVQC
2 void trigger_relay_teamcheck_use()
3 {
4         if(activator.team)
5         {
6                 if(self.spawnflags & 2)
7                 {
8                         if(DIFF_TEAM(activator, self))
9                                 SUB_UseTargets();
10                 }
11                 else
12                 {
13                         if(SAME_TEAM(activator, self))
14                                 SUB_UseTargets();
15                 }
16         }
17         else
18         {
19                 if(self.spawnflags & 1)
20                         SUB_UseTargets();
21         }
22 }
23
24 void trigger_relay_teamcheck_reset()
25 {
26         self.team = self.team_saved;
27 }
28
29 void spawnfunc_trigger_relay_teamcheck()
30 {
31         self.team_saved = self.team;
32         self.use = trigger_relay_teamcheck_use;
33         self.reset = trigger_relay_teamcheck_reset;
34 }
35 #endif