From: Rudolf Polzer Date: Tue, 20 Sep 2011 05:03:31 +0000 (+0200) Subject: bot scripting: if we have no command, don't do anything X-Git-Tag: xonotic-v0.6.0~40^2~124 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=8da4929ec905f11120967bb9dcbb239d77a3cfe6;p=xonotic%2Fxonotic-data.pk3dir.git bot scripting: if we have no command, don't do anything --- diff --git a/qcsrc/server/bot/scripting.qc b/qcsrc/server/bot/scripting.qc index d4773e81e..a35957805 100644 --- a/qcsrc/server/bot/scripting.qc +++ b/qcsrc/server/bot/scripting.qc @@ -1169,6 +1169,13 @@ float bot_execute_commands_once() // Find command bot_setcurrentcommand(); + // if we have no bot command, better return + // old logic kept pressing previously pressed keys, but that has problems + // (namely, it means you cannot make a bot "normal" ever again) + // to keep a bot walking for a while, use the "wait" bot command + if(bot_cmd == world) + return FALSE; + // Ignore all commands except continue when the bot is paused if(self.bot_exec_status & BOT_EXEC_STATUS_PAUSED) if(bot_cmd.bot_cmd_type!=BOT_CMD_CONTINUE) @@ -1184,9 +1191,6 @@ float bot_execute_commands_once() // Keep pressing keys raised by the "presskey" command ispressingkey = !!bot_presskeys(); - if(bot_cmd==world) - return ispressingkey; - // Handle conditions if not(bot_cmd.bot_cmd_type==BOT_CMD_FI||bot_cmd.bot_cmd_type==BOT_CMD_ELSE) if(self.bot_cmd_condition_status & CMD_CONDITION_TRUE && self.bot_cmd_condition_status & CMD_CONDITION_FALSE_BLOCK)