]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Only for bots skill 5 and up. Since only such both can reload weapons in their invent...
authorMircea Kitsune <sonichedgehog_hyperblast00@yahoo.com>
Fri, 11 Feb 2011 23:53:19 +0000 (01:53 +0200)
committerMircea Kitsune <sonichedgehog_hyperblast00@yahoo.com>
Fri, 11 Feb 2011 23:53:19 +0000 (01:53 +0200)
qcsrc/server/bot/havocbot/havocbot.qc

index 3490f148826bfaa06147a94ba13facb3cb79f973..7c7392085070df2a9f7a20cecf0592619c4b8aca 100644 (file)
@@ -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;
 }