Xonotic
relay_teamcheck.qc
Go to the documentation of this file.
1 #include "relay_teamcheck.qh"
2 
3 #ifdef SVQC
4 void trigger_relay_teamcheck_use(entity this, entity actor, entity trigger)
5 {
6  if(this.active != ACTIVE_ACTIVE)
7  return;
8 
9  if(actor.team)
10  {
12  {
13  if(DIFF_TEAM(actor, this))
14  SUB_UseTargets(this, actor, trigger);
15  }
16  else
17  {
18  if(SAME_TEAM(actor, this))
19  SUB_UseTargets(this, actor, trigger);
20  }
21  }
22  else
23  {
25  SUB_UseTargets(this, actor, trigger);
26  }
27 }
28 
29 void trigger_relay_teamcheck_reset(entity this)
30 {
31  this.active = ACTIVE_ACTIVE;
32  this.team = this.team_saved;
33 }
34 
35 spawnfunc(trigger_relay_teamcheck)
36 {
37  this.active = ACTIVE_ACTIVE;
38  this.team_saved = this.team;
39  IL_PUSH(g_saved_team, this);
40  this.use = trigger_relay_teamcheck_use;
41  this.reset = trigger_relay_teamcheck_reset;
42 }
43 #endif
int team
Definition: main.qh:157
int team_saved
Definition: vote.qh:68
entity() spawn
const int RELAYTEAMCHECK_NOTEAM
void SUB_UseTargets(entity this, entity actor, entity trigger)
Definition: triggers.qc:366
spawnfunc(info_player_attacker)
Definition: sv_assault.qc:283
#define DIFF_TEAM(a, b)
Definition: teams.qh:240
float spawnflags
Definition: progsdefs.qc:191
ERASEABLE entity IL_PUSH(IntrusiveList this, entity it)
Push to tail.
const int ACTIVE_ACTIVE
Definition: defs.qh:37
#define SAME_TEAM(a, b)
Definition: teams.qh:239
IntrusiveList g_saved_team
Definition: vote.qh:77
int active
Definition: defs.qh:34
const int RELAYTEAMCHECK_INVERT
#define use
Definition: csprogsdefs.qh:50