]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
fix auditing of bot scripting weapon state
authorRudolf Polzer <divverent@alientrap.org>
Wed, 21 Sep 2011 14:24:09 +0000 (16:24 +0200)
committerRudolf Polzer <divverent@alientrap.org>
Wed, 21 Sep 2011 14:24:09 +0000 (16:24 +0200)
qcsrc/server/bot/scripting.qc

index 99cf7391273d57ae19fdd49bc57f8c6f4c98ca5f..005d9ed881d46ead5e157421f22fed67fe83e746 100644 (file)
@@ -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;