From: Mircea Kitsune Date: Fri, 11 Feb 2011 22:06:58 +0000 (+0200) Subject: Make bots reload weapons when not attacking anyone. I'm not sure if the way I'm sendi... X-Git-Tag: xonotic-v0.5.0~309^2~7^2~34 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=1ba60d993e001d4ff9811bee7da15d5559089366;p=xonotic%2Fxonotic-data.pk3dir.git Make bots reload weapons when not attacking anyone. I'm not sure if the way I'm sending the impulse command is ok, however --- diff --git a/qcsrc/server/bot/havocbot/havocbot.qc b/qcsrc/server/bot/havocbot/havocbot.qc index 0c5b82b7a..17a64f5f4 100644 --- a/qcsrc/server/bot/havocbot/havocbot.qc +++ b/qcsrc/server/bot/havocbot/havocbot.qc @@ -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)