From: Rudolf Polzer Date: Sat, 10 Dec 2011 11:02:24 +0000 (+0100) Subject: bot_cmd aim: 3rd arg being 0 now does the same as 3rd arg missing X-Git-Tag: xonotic-v0.6.0~35^2~4 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=7b06af91f1f1d178a446903412a38d63c16728dd;p=xonotic%2Fxonotic-data.pk3dir.git bot_cmd aim: 3rd arg being 0 now does the same as 3rd arg missing --- diff --git a/qcsrc/server/bot/scripting.qc b/qcsrc/server/bot/scripting.qc index 6b1eba827..4b73ec14b 100644 --- a/qcsrc/server/bot/scripting.qc +++ b/qcsrc/server/bot/scripting.qc @@ -799,18 +799,18 @@ float bot_cmd_aim() tokens = tokenizebyseparator(parms, " "); - if(tokens==2) + if(tokens<2||tokens>3) + return CMD_STATUS_ERROR; + + step = (tokens == 3) ? stof(argv(2)) : 0; + + if(step == 0) { self.v_angle_x -= stof(argv(1)); self.v_angle_y += stof(argv(0)); return CMD_STATUS_FINISHED; } - if(tokens<2||tokens>3) - return CMD_STATUS_ERROR; - - step = stof(argv(2)); - self.bot_cmd_aim_begin = self.v_angle; self.bot_cmd_aim_end_x = self.v_angle_x - stof(argv(1));