From 1ba60d993e001d4ff9811bee7da15d5559089366 Mon Sep 17 00:00:00 2001 From: Mircea Kitsune Date: Sat, 12 Feb 2011 00:06:58 +0200 Subject: [PATCH] Make bots reload weapons when not attacking anyone. I'm not sure if the way I'm sending the impulse command is ok, however --- qcsrc/server/bot/havocbot/havocbot.qc | 6 ++++++ 1 file changed, 6 insertions(+) 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) -- 2.39.2