X-Git-Url: http://de.git.xonotic.org/?a=blobdiff_plain;f=qcsrc%2Fcommon%2Fturrets%2Ftargettrigger.qc;h=152a7d6a2715e362fde40fca3be8f20497ccc511;hb=268f9c69576b6bb929f66d19f0d077d19ba47edd;hp=4828bf0b34c17b078126affea19477e9d7929014;hpb=cf1edea8694548556934b5b05f526bc192f576cb;p=xonotic%2Fxonotic-data.pk3dir.git diff --git a/qcsrc/common/turrets/targettrigger.qc b/qcsrc/common/turrets/targettrigger.qc index 4828bf0b3..152a7d6a2 100644 --- a/qcsrc/common/turrets/targettrigger.qc +++ b/qcsrc/common/turrets/targettrigger.qc @@ -1,13 +1,15 @@ +#include "targettrigger.qh" 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 +18,9 @@ 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); }