From: Mario Date: Fri, 1 Jan 2016 10:46:16 +0000 (+1000) Subject: Use loop on race checkpoints X-Git-Tag: xonotic-v0.8.2~1335 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=dc9fc0666800659b3734e1c27f78edad022b8b72;p=xonotic%2Fxonotic-data.pk3dir.git Use loop on race checkpoints --- diff --git a/qcsrc/server/mutators/mutator/gamemode_cts.qc b/qcsrc/server/mutators/mutator/gamemode_cts.qc index b442b0706..1ce78a1f7 100644 --- a/qcsrc/server/mutators/mutator/gamemode_cts.qc +++ b/qcsrc/server/mutators/mutator/gamemode_cts.qc @@ -56,23 +56,18 @@ void havocbot_role_cts() if(IS_DEAD(self)) return; - entity e; if (self.bot_strategytime < time) { self.bot_strategytime = time + autocvar_bot_ai_strategyinterval; navigation_goalrating_start(); - for(e = world; (e = find(e, classname, "trigger_race_checkpoint")) != world; ) + FOREACH_ENTITY_CLASS("trigger_race_checkpoint", true, { - if(e.cnt == self.race_checkpoint) - { - navigation_routerating(e, 1000000, 5000); - } + if(it.cnt == self.race_checkpoint) + navigation_routerating(it, 1000000, 5000); else if(self.race_checkpoint == -1) - { - navigation_routerating(e, 1000000, 5000); - } - } + navigation_routerating(it, 1000000, 5000); + }); navigation_goalrating_end(); }