From 6f3f80dffd797987d7bf8f1e7dca721fbe1221f3 Mon Sep 17 00:00:00 2001 From: Rudolf Polzer Date: Wed, 21 Sep 2011 16:24:09 +0200 Subject: [PATCH] fix auditing of bot scripting weapon state --- qcsrc/server/bot/scripting.qc | 28 ++++++++++++++++++++++------ 1 file changed, 22 insertions(+), 6 deletions(-) diff --git a/qcsrc/server/bot/scripting.qc b/qcsrc/server/bot/scripting.qc index 99cf73912..005d9ed88 100644 --- a/qcsrc/server/bot/scripting.qc +++ b/qcsrc/server/bot/scripting.qc @@ -1100,13 +1100,29 @@ float bot_cmd_debug_assert_canfire() float f; f = bot_cmd.bot_cmd_parm_float; - float canfire; - canfire = (self.weaponentity.state == WS_READY) && (ATTACK_FINISHED(self) <= time); - - if(canfire != f) + if(self.weaponentity.state != WS_READY) + { + if(f) + { + self.colormod = '0 8 8'; + print("Bot wants to fire, inhibited by weaponentity state\n"); + } + } + else if(ATTACK_FINISHED(self) > time) + { + if(f) + { + self.colormod = '8 0 8'; + print("Bot wants to fire, inhibited by ATTACK_FINISHED\n"); + } + } + else { - self.glowmod = '8 0 8'; - print(sprintf("Bot canfire state expected to be %d, really is %d\n", f, self.weaponentity.state)); + if(!f) + { + self.colormod = '8 8 0'; + print("Bot thinks it has fired, but apparently did not\n"); + } } return CMD_STATUS_FINISHED; -- 2.39.2