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

@ -110,7 +110,7 @@ cmd_sail_ship(struct nstr_item *nstr)
struct shpstr ship;
char navpath[MAX_PATH_LEN];
while (!player->aborted && nxtitem(nstr, &ship)) {
while (nxtitem(nstr, &ship)) {
if (!player->owner || ship.shp_own == 0)
continue;
if ((ship.shp_autonav & AN_AUTONAV) &&
@ -123,13 +123,13 @@ cmd_sail_ship(struct nstr_item *nstr)
xyas(ship.shp_x, ship.shp_y, ship.shp_own));
cp = getpath(navpath, player->argp[2],
ship.shp_x, ship.shp_y, 0, 0, P_SAILING);
if (!cp)
return RET_SYN;
if (!check_ship_ok(&ship))
continue;
if (!player->aborted) {
strncpy(ship.shp_path, cp, sizeof(ship.shp_path) - 2);
ship.shp_mission = 0;
putship(ship.shp_uid, &ship);
}
strncpy(ship.shp_path, cp, sizeof(ship.shp_path) - 2);
ship.shp_mission = 0;
putship(ship.shp_uid, &ship);
}
return RET_OK;
}