From: Rudolf Polzer Date: Wed, 21 Sep 2011 14:24:09 +0000 (+0200) Subject: fix auditing of bot scripting weapon state X-Git-Tag: xonotic-v0.6.0~40^2~122 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=6f3f80dffd797987d7bf8f1e7dca721fbe1221f3;p=xonotic%2Fxonotic-data.pk3dir.git fix auditing of bot scripting weapon state --- 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;