(multifire): When an argument is bad, do not loop prompting, just
fail. That's what the vast majority of commands do.
This commit is contained in:
parent
1c703efa96
commit
fe1a3e57c6
1 changed files with 19 additions and 21 deletions
|
@ -126,13 +126,10 @@ multifire(void)
|
|||
|
||||
emp_initque(&fired);
|
||||
emp_initque(&defended);
|
||||
type = -1;
|
||||
while ((type != EF_SECTOR) && (type != EF_SHIP) && (type != EF_LAND)) {
|
||||
if (!(p = getstarg(player->argp[1],
|
||||
"Firing from ship(s), sect(s), or land unit(s)? ",
|
||||
buf)))
|
||||
return RET_SYN;
|
||||
player->argp[1] = 0;
|
||||
type = ef_byname_from(p, ef_with_guns);
|
||||
if (type == EF_SECTOR) {
|
||||
if (opt_NO_FORT_FIRE) {
|
||||
|
@ -145,8 +142,9 @@ multifire(void)
|
|||
orig_attacker = attacker = targ_ship;
|
||||
} else if (type == EF_LAND) {
|
||||
orig_attacker = attacker = targ_unit;
|
||||
} else
|
||||
pr("Please type 'sh', 'l', or 'se'!\n");
|
||||
} else {
|
||||
pr("Ships, land units or sectors only!\n");
|
||||
return RET_SYN;
|
||||
}
|
||||
if ((ptr = getstarg(player->argp[2], "Firing from? ", buf)) == 0
|
||||
|| *ptr == '\0')
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue