]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Skill limits for each bot reloading decision. Also improve some comments
authorMircea Kitsune <sonichedgehog_hyperblast00@yahoo.com>
Fri, 11 Feb 2011 22:37:11 +0000 (00:37 +0200)
committerMircea Kitsune <sonichedgehog_hyperblast00@yahoo.com>
Fri, 11 Feb 2011 22:37:11 +0000 (00:37 +0200)
qcsrc/server/bot/havocbot/havocbot.qc

index 7d1ef3a08f4bd82a7071045ddbf54c5c0f8f39f9..2b58dd7dc2321aceb1226b9468763cf57e463991 100644 (file)
@@ -153,6 +153,7 @@ void havocbot_ai()
                entity e;
 
                // we are currently holding a weapon that's not fully loaded, reload it
+               if(skill > 2.5) // bots can only reload held weapons on purpose past this skill
                if(self.clip_load < self.clip_size && self.weapon)
                {
                        self.impulse = 20; // "press" the reload button, not sure if this is done right
@@ -160,6 +161,8 @@ void havocbot_ai()
                }
 
                // if we're not reloading a weapon, switch to any weapon in our invnetory that's not fully loaded to reload it next
+               // the code above executes next frame, starting the reloading then
+               if(skill >= 5) // bots can only switch to unloaded weapons to reload them past this skill
                if(self.clip_load >= 0)
                {
                        for(i = WEP_FIRST; i <= WEP_LAST ; ++i)