X-Git-Url: https://de.git.xonotic.org/?a=blobdiff_plain;f=qcsrc%2Fcommon%2Fturrets%2Ftargettrigger.qc;h=f2a97d4a12529e6fd576819d7509b5bd55597937;hb=06ac66a5edaa645e19ed9a6482409e8656a65b1d;hp=01dced5f3c403f0ec3af2ad263290d7ba64186c1;hpb=1add7fc6b9e512dcfcfd3180505046449ac782cd;p=xonotic%2Fxonotic-data.pk3dir.git diff --git a/qcsrc/common/turrets/targettrigger.qc b/qcsrc/common/turrets/targettrigger.qc index 01dced5f3..f2a97d4a1 100644 --- a/qcsrc/common/turrets/targettrigger.qc +++ b/qcsrc/common/turrets/targettrigger.qc @@ -1,13 +1,14 @@ +#include "targettrigger.qh" spawnfunc(turret_targettrigger); -void turret_targettrigger_touch(); +void turret_targettrigger_touch(entity this, entity toucher); -void turret_targettrigger_touch() -{SELFPARAM(); +void turret_targettrigger_touch(entity this, entity toucher) +{ if (this.cnt > time) return; FOREACH_ENTITY_STRING_ORDERED(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 +17,9 @@ void turret_targettrigger_touch() */ 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); }