From 928d1b1feb77e31b8ead175704d085f02f17231f Mon Sep 17 00:00:00 2001 From: terencehill Date: Fri, 21 Aug 2015 01:22:31 +0200 Subject: [PATCH] Make misc_breakablemodel entities secondary target for bots so they never prefer shooting barrels over players --- qcsrc/server/bot/havocbot/havocbot.qc | 23 +++++++++++++++++++++-- 1 file changed, 21 insertions(+), 2 deletions(-) diff --git a/qcsrc/server/bot/havocbot/havocbot.qc b/qcsrc/server/bot/havocbot/havocbot.qc index 3ccf95187..0d5f04c90 100644 --- a/qcsrc/server/bot/havocbot/havocbot.qc +++ b/qcsrc/server/bot/havocbot/havocbot.qc @@ -909,10 +909,23 @@ void havocbot_chooseenemy() self.dphitcontentsmask = DPCONTENTS_SOLID | DPCONTENTS_BODY | DPCONTENTS_CORPSE; bool scan_transparent = false; + bool scan_secondary_targets = false; while(true) { - while (head) + scan_secondary_targets = false; + for ( ; head; head = head.chain) { + if(!scan_secondary_targets) + { + if(head.classname == "misc_breakablemodel") + continue; + } + else + { + if(head.classname != "misc_breakablemodel") + continue; + } + v = (head.absmin + head.absmax) * 0.5; rating = vlen(v - eye); if (rating