Cleanse the touch functions of the other evil
[xonotic/xonotic-data.pk3dir.git] / qcsrc / common / turrets / targettrigger.qc
1 spawnfunc(turret_targettrigger);
2 void turret_targettrigger_touch(entity this, entity toucher);
3
4 void turret_targettrigger_touch(entity this, entity toucher)
5 {
6     if (this.cnt > time) return;
7     FOREACH_ENTITY_STRING_ORDERED(targetname, this.target, {
8         if (!(it.turret_flags & TUR_FLAG_RECIEVETARGETS)) continue;
9         if (!it.turret_addtarget) continue;
10         it.turret_addtarget(it, toucher, this);
11     });
12     this.cnt = time + 0.5;
13 }
14
15 /*QUAKED turret_targettrigger (.5 .5 .5) ?
16 */
17 spawnfunc(turret_targettrigger)
18 {
19     if(!autocvar_g_turrets) { remove(this); return; }
20
21     InitTrigger(this);
22
23     settouch(this, turret_targettrigger_touch);
24 }