march: Check for sector abandonment before anyone marches
Unlike the move command, march checks sector abandonment before every step. If the player declines, the last land unit stays put and is removed from the march. Except when sectors or land units change while we're waiting for the player's reply. Then the last unit is not removed from the march. This can scatter land units. Screwed up when checking for abandoning the sector was added in 4.2.2. Change march to work like move, and to avoid scattering land units: if the player declines to abandon the sector, the command simply fails. Put the check into new lnd_abandon_askyn(). Extend would_abandon() and want_to_abandon() from a single land unit to many. Rename the latter to abandon_askyn() for consistency. Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
This commit is contained in:
parent
3b9f2a149b
commit
7c1b1661f5
11 changed files with 71 additions and 47 deletions
|
@ -30,7 +30,7 @@
|
|||
* David Sharnoff, 1987
|
||||
* Ken Stevens, 1995 (rewritten)
|
||||
* Steve McClure, 1998-2000
|
||||
* Markus Armbruster, 2004-2013
|
||||
* Markus Armbruster, 2004-2014
|
||||
*/
|
||||
|
||||
#include <config.h>
|
||||
|
@ -692,7 +692,7 @@ load_comm_ship(struct sctstr *sectp, struct shpstr *sp,
|
|||
load_unload, atoi(p));
|
||||
if (!load_comm_ok(sectp, sp->shp_own, item, move_amt))
|
||||
return RET_OK;
|
||||
if (!want_to_abandon(sectp, item, move_amt, NULL))
|
||||
if (!abandon_askyn(sectp, item, move_amt, NULL))
|
||||
return RET_FAIL;
|
||||
if (!still_ok_ship(sectp, sp))
|
||||
return RET_SYN;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue