X-Git-Url: http://de.git.xonotic.org/?a=blobdiff_plain;f=qcsrc%2Fcommon%2Fturrets%2Ftargettrigger.qc;h=d64616f50354ca6ad092c4a0b1dae10a6ef8881b;hb=e2206feb6fec163ffee9c87d50d8d9580393cd88;hp=4828bf0b34c17b078126affea19477e9d7929014;hpb=3d4a324cc2e15c1eb99209674942506eb998e2ec;p=xonotic%2Fxonotic-data.pk3dir.git diff --git a/qcsrc/common/turrets/targettrigger.qc b/qcsrc/common/turrets/targettrigger.qc index 4828bf0b34..d64616f503 100644 --- a/qcsrc/common/turrets/targettrigger.qc +++ b/qcsrc/common/turrets/targettrigger.qc @@ -1,13 +1,18 @@ +#include "targettrigger.qh" + +#ifdef SVQC + spawnfunc(turret_targettrigger); -void turret_targettrigger_touch(entity this); +void turret_targettrigger_touch(entity this, entity toucher); -void turret_targettrigger_touch(entity this) +void turret_targettrigger_touch(entity this, entity toucher) { if (this.cnt > time) return; - FOREACH_ENTITY_STRING_ORDERED(targetname, this.target, { + IL_EACH(g_turrets, it.targetname == this.target, + { if (!(it.turret_flags & TUR_FLAG_RECIEVETARGETS)) continue; if (!it.turret_addtarget) continue; - WITHSELF(it, it.turret_addtarget(other, this)); + it.turret_addtarget(it, toucher, this); }); this.cnt = time + 0.5; } @@ -16,9 +21,11 @@ void turret_targettrigger_touch(entity this) */ spawnfunc(turret_targettrigger) { - if(!autocvar_g_turrets) { remove(this); return; } + if(!autocvar_g_turrets) { delete(this); return; } - WITHSELF(this, InitTrigger()); + InitTrigger(this); settouch(this, turret_targettrigger_touch); } + +#endif