]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Use loop on race checkpoints
authorMario <mario@smbclan.net>
Fri, 1 Jan 2016 10:46:16 +0000 (20:46 +1000)
committerMario <mario@smbclan.net>
Fri, 1 Jan 2016 10:46:16 +0000 (20:46 +1000)
qcsrc/server/mutators/mutator/gamemode_cts.qc

index b442b0706d213fbd5dfe8507ecdde377708bea8e..1ce78a1f74b60e27a233bb4210d1cf458c5f2062 100644 (file)
@@ -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();
        }