Xonotic
targettrigger.qc
Go to the documentation of this file.
1 #include "targettrigger.qh"
2 
3 #ifdef SVQC
4 
5 spawnfunc(turret_targettrigger);
6 void turret_targettrigger_touch(entity this, entity toucher);
7 
8 void turret_targettrigger_touch(entity this, entity toucher)
9 {
10  if (this.cnt > time) return;
11  IL_EACH(g_turrets, it.targetname == this.target,
12  {
13  if (!(it.turret_flags & TUR_FLAG_RECIEVETARGETS)) continue;
14  if (!it.turret_addtarget) continue;
15  it.turret_addtarget(it, toucher, this);
16  });
17  this.cnt = time + 0.5;
18 }
19 
20 /*QUAKED turret_targettrigger (.5 .5 .5) ?
21 */
22 spawnfunc(turret_targettrigger)
23 {
24  if(!autocvar_g_turrets) { delete(this); return; }
25 
26  InitTrigger(this);
27 
28  settouch(this, turret_targettrigger_touch);
29 }
30 
31 #endif
#define IL_EACH(this, cond, body)
entity() spawn
spawnfunc(info_player_attacker)
Definition: sv_assault.qc:283
IntrusiveList g_turrets
Definition: sv_turrets.qh:114
float cnt
Definition: powerups.qc:24
bool autocvar_g_turrets
Definition: sv_turrets.qh:5
float time
Definition: csprogsdefs.qc:16