X-Git-Url: http://de.git.xonotic.org/?p=xonotic%2Fxonotic-data.pk3dir.git;a=blobdiff_plain;f=qcsrc%2Fcommon%2Fturrets%2Ftargettrigger.qc;h=152a7d6a2715e362fde40fca3be8f20497ccc511;hp=62ed2fb722dc6cca55a20d4460f391681cc058e3;hb=8802dc71a56bfe87db766c6dab331046575f7eb9;hpb=2300937585fd409c578a516ed5e051ba389646d4 diff --git a/qcsrc/common/turrets/targettrigger.qc b/qcsrc/common/turrets/targettrigger.qc index 62ed2fb72..152a7d6a2 100644 --- a/qcsrc/common/turrets/targettrigger.qc +++ b/qcsrc/common/turrets/targettrigger.qc @@ -1,10 +1,12 @@ +#include "targettrigger.qh" spawnfunc(turret_targettrigger); void turret_targettrigger_touch(entity this, entity toucher); 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; it.turret_addtarget(it, toucher, this); @@ -16,7 +18,7 @@ void turret_targettrigger_touch(entity this, entity toucher) */ spawnfunc(turret_targettrigger) { - if(!autocvar_g_turrets) { remove(this); return; } + if(!autocvar_g_turrets) { delete(this); return; } InitTrigger(this);