From: terencehill Date: Thu, 20 Aug 2015 23:22:31 +0000 (+0200) Subject: Make misc_breakablemodel entities secondary target for bots so they never prefer... X-Git-Tag: xonotic-v0.8.2~1891^2~8 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=928d1b1feb77e31b8ead175704d085f02f17231f;p=xonotic%2Fxonotic-data.pk3dir.git Make misc_breakablemodel entities secondary target for bots so they never prefer shooting barrels over players --- 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