[nexuiz-commits] r7276 - trunk/data/qcsrc/server

DONOTREPLY at icculus.org DONOTREPLY at icculus.org
Mon Jul 27 12:04:10 EDT 2009


Author: mand1nga
Date: 2009-07-27 12:04:06 -0400 (Mon, 27 Jul 2009)
New Revision: 7276

Modified:
   trunk/data/qcsrc/server/bots_scripting.qc
Log:
Fixed a bug that was making bots stop executing commands if an inexistent command was given

Modified: trunk/data/qcsrc/server/bots_scripting.qc
===================================================================
--- trunk/data/qcsrc/server/bots_scripting.qc	2009-07-26 18:57:27 UTC (rev 7275)
+++ trunk/data/qcsrc/server/bots_scripting.qc	2009-07-27 16:04:06 UTC (rev 7276)
@@ -1063,11 +1063,10 @@
 		self.bot_cmd_current = spawn();
 		self.bot_cmd_current.classname = "bot_cmd";
 		self.bot_cmd_current.is_bot_cmd = 1;
-		self.bot_cmd_current.bot_cmd_index = 1;
 	}
 
 	bot_cmd = self.bot_cmd_current;
-	if(bot_cmd.bot_cmd_index != self.bot_cmd_execution_index)
+	if(bot_cmd.bot_cmd_index != self.bot_cmd_execution_index || self.bot_cmd_execution_index == 0)
 	{
 		if(bot_havecommand(self, self.bot_cmd_execution_index))
 		{
@@ -1079,7 +1078,12 @@
 				bot_cmd.bot_cmd_index = self.bot_cmd_execution_index;
 			}
 			else
+			{
+				// Invalid command, remove from queue
 				bot_cmd = world;
+				bot_dequeuecommand(self, self.bot_cmd_execution_index);
+				self.bot_cmd_execution_index++;
+			}
 		}
 		else
 			bot_cmd = world;



More information about the nexuiz-commits mailing list