Get third argument of "order l" the ordinary way
authorMarkus Armbruster <armbru@pond.sub.org>
Tue, 26 Jan 2010 20:48:26 +0000 (21:48 +0100)
committerMarkus Armbruster <armbru@pond.sub.org>
Tue, 26 Jan 2010 20:48:54 +0000 (21:48 +0100)
Now prompts when the argument is empty.  Before, that was interpreted
as zero.  Not likely to affect players.

src/lib/commands/orde.c

index 591069fc353f3d02766fa9cceb52784f0b5eff8e..7520a77e39649a9ec445b43a388dc96fc1ed7302 100644 (file)
@@ -166,14 +166,10 @@ orde(void)
 
        case 'l':
            /* convert player->argp[3] to an integer */
-           if (player->argp[3])
-               sub = atoi(player->argp[3]);
-           else {
-               sprintf(buf1, "Field (1-%d) ", TMAX);
-               if (!getstarg(player->argp[3], buf1, buf))
-                   return RET_SYN;
-               sub = atoi(buf);
-           }
+           sprintf(buf1, "Field (1-%d) ", TMAX);
+           if (!getstarg(player->argp[3], buf1, buf))
+               return RET_SYN;
+           sub = atoi(buf);
            /* check to make sure value in within range. */
            if (sub > TMAX || sub < 1) {
                pr("Value must range from 1 to %d\n", TMAX);