]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Make bots reload weapons when not attacking anyone. I'm not sure if the way I'm sendi...
authorMircea Kitsune <sonichedgehog_hyperblast00@yahoo.com>
Fri, 11 Feb 2011 22:06:58 +0000 (00:06 +0200)
committerMircea Kitsune <sonichedgehog_hyperblast00@yahoo.com>
Fri, 11 Feb 2011 22:06:58 +0000 (00:06 +0200)
qcsrc/server/bot/havocbot/havocbot.qc

index 0c5b82b7a9d14a7dbf2badd8022098f70e790853..17a64f5f42fae0fb54a035111679052ed47f7a3a 100644 (file)
@@ -145,6 +145,12 @@ void havocbot_ai()
                bot_aimdir(v, -1);
        }
        havocbot_movetogoal();
+
+       // if the bot is not attacking anyone and holding a weapon that's not fully loaded,
+       // now it's a good time to try reloading it
+       if not(self.aistatus & AI_STATUS_ATTACKING)
+       if(self.clip_load < self.clip_size)
+               self.impulse = 20;
 };
 
 void havocbot_keyboard_movement(vector destorg)