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=15dbaec4f009b0c8d87fba54e6c0269c72f41709;hb=8802dc71a56bfe87db766c6dab331046575f7eb9;hpb=eac60648c4017e495060dd3ba9e50ac4bad5000a diff --git a/qcsrc/common/turrets/targettrigger.qc b/qcsrc/common/turrets/targettrigger.qc index 15dbaec4f..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; - it.turret_addtarget(it, other, this); + it.turret_addtarget(it, toucher, this); }); this.cnt = time + 0.5; } @@ -16,7 +18,7 @@ void turret_targettrigger_touch(entity this) */ spawnfunc(turret_targettrigger) { - if(!autocvar_g_turrets) { remove(this); return; } + if(!autocvar_g_turrets) { delete(this); return; } InitTrigger(this);