From: Mario Date: Mon, 22 Aug 2016 07:56:53 +0000 (+1000) Subject: Some more intrusiveness X-Git-Tag: xonotic-v0.8.2~663^2~6 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=6965437c2085de3ed771480d4bb95416c347653d;p=xonotic%2Fxonotic-data.pk3dir.git Some more intrusiveness --- diff --git a/qcsrc/common/turrets/targettrigger.qc b/qcsrc/common/turrets/targettrigger.qc index f2a97d4a1..152a7d6a2 100644 --- a/qcsrc/common/turrets/targettrigger.qc +++ b/qcsrc/common/turrets/targettrigger.qc @@ -5,7 +5,8 @@ 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); diff --git a/qcsrc/common/vehicles/sv_vehicles.qc b/qcsrc/common/vehicles/sv_vehicles.qc index a010ba2c4..cf1f642d4 100644 --- a/qcsrc/common/vehicles/sv_vehicles.qc +++ b/qcsrc/common/vehicles/sv_vehicles.qc @@ -433,17 +433,15 @@ void vehicles_reset_colors(entity 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); }); } @@ -513,6 +511,7 @@ void vehicles_setreturn(entity veh) 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); @@ -1076,8 +1075,9 @@ void vehicles_spawn(entity this) 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'; diff --git a/qcsrc/common/vehicles/sv_vehicles.qh b/qcsrc/common/vehicles/sv_vehicles.qh index 158191f65..948427db3 100644 --- a/qcsrc/common/vehicles/sv_vehicles.qh +++ b/qcsrc/common/vehicles/sv_vehicles.qh @@ -108,4 +108,7 @@ bool vehicle_impulse(entity this, int imp); bool vehicles_crushable(entity e); float vehicle_altitude(entity this, float amax); +IntrusiveList g_vehicle_returners; +STATIC_INIT(g_vehicle_returners) { g_vehicle_returners = IL_NEW(); } + #endif