From 7a0a311ff868e71c2336e0cdffdadad6a55fac8f Mon Sep 17 00:00:00 2001 From: terencehill Date: Sat, 22 Aug 2015 23:58:39 +0200 Subject: [PATCH] Something else was wrong :/ --- qcsrc/server/bot/havocbot/havocbot.qc | 24 ++++++++++-------------- 1 file changed, 10 insertions(+), 14 deletions(-) diff --git a/qcsrc/server/bot/havocbot/havocbot.qc b/qcsrc/server/bot/havocbot/havocbot.qc index ee7b54934..08b821aba 100644 --- a/qcsrc/server/bot/havocbot/havocbot.qc +++ b/qcsrc/server/bot/havocbot/havocbot.qc @@ -914,24 +914,21 @@ void havocbot_chooseenemy() while(true) { scan_secondary_targets = false; - while(head) + :scan_targets + for( ; head; head = head.chain) { if(!scan_secondary_targets) { if(head.classname == "misc_breakablemodel") { have_secondary_targets = true; - head = head.chain; continue; } } else { if(head.classname != "misc_breakablemodel") - { - head = head.chain; continue; - } } v = (head.absmin + head.absmax) * 0.5; @@ -947,16 +944,15 @@ void havocbot_chooseenemy() bestrating = rating; } } + } - if(!best && have_secondary_targets && !scan_secondary_targets) - { - scan_secondary_targets = true; - // restart the loop - head = head2; - bestrating = 100000000; - } - else - head = head.chain; + if(!best && have_secondary_targets && !scan_secondary_targets) + { + scan_secondary_targets = true; + // restart the loop + head = head2; + bestrating = 100000000; + goto scan_targets; } // I want to do a second scan if no enemy was found or I don't have weapons -- 2.39.2