Get third argument of "order l" the ordinary way

Now prompts when the argument is empty.  Before, that was interpreted
as zero.  Not likely to affect players.
This commit is contained in:
Markus Armbruster 2010-01-26 21:48:26 +01:00
parent ae6ad76516
commit 7ac10453a2

View file

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