From: Mircea Kitsune Date: Fri, 11 Feb 2011 23:53:19 +0000 (+0200) Subject: Only for bots skill 5 and up. Since only such both can reload weapons in their invent... X-Git-Tag: xonotic-v0.5.0~309^2~7^2~23 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=e3d682875c13c56b2bcae1da8815e6f02fe60e0c;p=xonotic%2Fxonotic-data.pk3dir.git Only for bots skill 5 and up. Since only such both can reload weapons in their inventory idly, so not switching to unloaded weapons for lower skills would cause them to never reload their guns. This also makes bots more stupid at lower skills, causing them to switch to guns they'll then have to reload during fighting. --- diff --git a/qcsrc/server/bot/havocbot/havocbot.qc b/qcsrc/server/bot/havocbot/havocbot.qc index 3490f1488..7c7392085 100644 --- a/qcsrc/server/bot/havocbot/havocbot.qc +++ b/qcsrc/server/bot/havocbot/havocbot.qc @@ -942,6 +942,12 @@ void havocbot_chooseenemy() float havocbot_chooseweapon_checkreload(float new_weapon) { + // bots under this skill cannot find unloaded weapons to reload idly when not in combat, + // so skip this for them, or they'll never get to reload their weapons at all. + // this also allows bots under this skill to be more stupid, and reload more often during combat :) + if(skill < 5) + return FALSE; + // if this weapon is scheduled for reloading, don't switch to it during combat if (self.weapon_load[new_weapon] < 0) { @@ -955,6 +961,7 @@ float havocbot_chooseweapon_checkreload(float new_weapon) if(other_weapon_available) return TRUE; } + return FALSE; }