From: Mario Date: Sun, 21 Aug 2016 12:55:58 +0000 (+1000) Subject: Purge a few cases of FOREACH_ENTITY_ENT X-Git-Tag: xonotic-v0.8.2~663^2~26 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=f441ef86e5341c95c47a2fdeda396775260f143d;p=xonotic%2Fxonotic-data.pk3dir.git Purge a few cases of FOREACH_ENTITY_ENT --- diff --git a/qcsrc/common/vehicles/vehicle/spiderbot.qc b/qcsrc/common/vehicles/vehicle/spiderbot.qc index fc8a4f190..ec0610482 100644 --- a/qcsrc/common/vehicles/vehicle/spiderbot.qc +++ b/qcsrc/common/vehicles/vehicle/spiderbot.qc @@ -314,9 +314,8 @@ void spiderbot_exit(entity this, int eject) { vector spot; - FOREACH_ENTITY_ENT(owner, this.owner, + IL_EACH(g_projectiles, it.owner == this.owner && it.classname == "spiderbot_rocket", { - if(it.classname != "spiderbot_rocket") continue; it.realowner = this.owner; it.owner = NULL; }); diff --git a/qcsrc/common/vehicles/vehicle/spiderbot_weapons.qc b/qcsrc/common/vehicles/vehicle/spiderbot_weapons.qc index dc1f6ba60..5f7a2c31c 100644 --- a/qcsrc/common/vehicles/vehicle/spiderbot_weapons.qc +++ b/qcsrc/common/vehicles/vehicle/spiderbot_weapons.qc @@ -48,16 +48,17 @@ void spiderbot_rocket_guided(entity this) void spiderbot_guide_release(entity this) { - FOREACH_ENTITY_ENT(realowner, this.owner, + bool donetrace = false; + IL_EACH(g_projectiles, it.realowner == this.owner && getthink(it) == spiderbot_rocket_guided, { - if(i == 0) // something exists, let's trace! - crosshair_trace(this.owner); - - if(getthink(it) == spiderbot_rocket_guided) + if(!donetrace) // something exists, let's trace! { - it.pos1 = trace_endpos; - setthink(it, spiderbot_rocket_unguided); + donetrace = true; + crosshair_trace(this.owner); } + + it.pos1 = trace_endpos; + setthink(it, spiderbot_rocket_unguided); }); } diff --git a/qcsrc/common/weapons/weapon/devastator.qc b/qcsrc/common/weapons/weapon/devastator.qc index 5ffe08bad..d44ee7ec2 100644 --- a/qcsrc/common/weapons/weapon/devastator.qc +++ b/qcsrc/common/weapons/weapon/devastator.qc @@ -460,10 +460,8 @@ METHOD(Devastator, wr_aim, void(entity thiswep, entity actor)) selfdamage = 0; teamdamage = 0; enemydamage = 0; - FOREACH_ENTITY_ENT(realowner, actor, + IL_EACH(g_projectiles, it.realowner == actor && it.classname == "rocket", { - if(it.classname != "rocket") continue; - entity rocket = it; FOREACH_ENTITY_FLOAT(bot_attack, true, { @@ -486,10 +484,8 @@ METHOD(Devastator, wr_aim, void(entity thiswep, entity actor)) desirabledamage = desirabledamage - teamdamage; makevectors(actor.v_angle); - FOREACH_ENTITY_ENT(realowner, actor, + IL_EACH(g_projectiles, it.realowner == actor && it.classname == "rocket", { - if(it.classname != "rocket") continue; - if(skill > 9) // normal players only do this for the target they are tracking { entity rocket = it;