]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Fix subtle bug in a for loop (loop was restarted from head.chain instead of head)
authorterencehill <piuntn@gmail.com>
Sat, 22 Aug 2015 20:01:14 +0000 (22:01 +0200)
committerterencehill <piuntn@gmail.com>
Sat, 22 Aug 2015 20:01:14 +0000 (22:01 +0200)
qcsrc/server/bot/havocbot/havocbot.qc

index 3036012754c8fcacce0ed5c9904312c30e5a9ecc..b36c79830d31f7b32cc1cdf13c013cc9531d9623 100644 (file)
@@ -914,7 +914,7 @@ void havocbot_chooseenemy()
        while(true)
        {
                scan_secondary_targets = false;
-               for ( ; head; head = head.chain)
+               while(head)
                {
                        if(!scan_secondary_targets)
                        {
@@ -951,6 +951,8 @@ void havocbot_chooseenemy()
                                head = head2;
                                bestrating = 100000000;
                        }
+                       else
+                               head = head.chain;
                }
 
                // I want to do a second scan if no enemy was found or I don't have weapons