Fix command abortion after getting player input

The old code didn't honor command abortion at the following prompts:

* arm third argument

* deliver fourth argument (also simplify)

* fire third argument

* fly and recon prompt for carrier to land on: pln_onewaymission()
  treated abort like empty input, which made planes attempt landing in
  the sector.

* lmine second argument

* order d fourth argument

* power c nat(s) argument

* range second argument

* sail second argument

* shutdown both arguments (first one was broken in commit 84cfd670,
  v4.3.10, second one never worked).

* tend third argument
This commit is contained in:
Markus Armbruster 2008-07-15 07:55:42 -04:00
parent b3a7a8ee11
commit 9eda5f87b8
11 changed files with 51 additions and 32 deletions

View file

@ -55,7 +55,7 @@ deli(void)
if (!snxtsct(&nstr, player->argp[2]))
return RET_SYN;
while (!player->aborted && nxtsct(&nstr, &sect) > 0) {
while (nxtsct(&nstr, &sect) > 0) {
if (!player->owner)
continue;
@ -69,15 +69,17 @@ deli(void)
if (!(p = getstarg(player->argp[3], prompt, buf)) || !*p)
return RET_SYN;
if (*p != 'q') {
sprintf(prompt, "%s %s %s direction? ",
xyas(nstr.x, nstr.y, player->cnum),
dchr[sect.sct_type].d_name, ich->i_name);
if (((*p >= '0') && (*p <= '9')) || *p == '+') {
thresh = atoi(p) & ~0x7;
if (*p == '+')
p = NULL;
else {
sprintf(prompt, "%s %s %s direction? ",
xyas(nstr.x, nstr.y, player->cnum),
dchr[sect.sct_type].d_name, ich->i_name);
p = getstarg(player->argp[4], prompt, buf);
if (!p)
return RET_SYN;
}
}
if (p && *p) {