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);
void vehicles_clearreturn(entity veh)
{
// Remove "return helper" entities, if any.
- FOREACH_ENTITY_ENT(wp00, veh,
+ IL_EACH(g_vehicle_returners, it.wp00 == veh,
{
- if(it.classname == "vehicle_return")
- {
- it.classname = "";
- setthink(it, SUB_Remove);
- it.nextthink = time + 0.1;
+ it.classname = "";
+ setthink(it, SUB_Remove);
+ it.nextthink = time + 0.1;
+ IL_REMOVE(g_vehicle_returners, it);
- if(it.waypointsprite_attached)
- WaypointSprite_Kill(it.waypointsprite_attached);
- }
+ if(it.waypointsprite_attached)
+ WaypointSprite_Kill(it.waypointsprite_attached);
});
}
vehicles_clearreturn(veh);
entity ret = new(vehicle_return);
+ IL_PUSH(g_vehicle_returners, ret);
ret.wp00 = veh;
ret.team = veh.team;
setthink(ret, vehicles_showwp);
this.solid = SOLID_SLIDEBOX;
this.takedamage = DAMAGE_AIM;
this.deadflag = DEAD_NO;
+ if(!this.bot_attack)
+ IL_PUSH(g_bot_targets, this);
this.bot_attack = true;
- IL_PUSH(g_bot_targets, this);
this.flags = FL_NOTARGET;
this.avelocity = '0 0 0';
this.velocity = '0 0 0';