]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
bot_cmd aim: 3rd arg being 0 now does the same as 3rd arg missing
authorRudolf Polzer <divverent@xonotic.org>
Sat, 10 Dec 2011 11:02:24 +0000 (12:02 +0100)
committerRudolf Polzer <divverent@xonotic.org>
Sat, 10 Dec 2011 11:02:24 +0000 (12:02 +0100)
qcsrc/server/bot/scripting.qc

index 6b1eba8277d9cc9f8ab7ccc6b65d765ef387137b..4b73ec14b62cae43f8f52eb0295e3ac1f8df8c71 100644 (file)
@@ -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));