]> git.pond.sub.org Git - empserver/commit
march: Check for sector abandonment before anyone marches
authorMarkus Armbruster <armbru@pond.sub.org>
Sun, 28 Dec 2014 20:55:44 +0000 (21:55 +0100)
committerMarkus Armbruster <armbru@pond.sub.org>
Sat, 28 Feb 2015 15:13:14 +0000 (16:13 +0100)
commit7c1b1661f5dae7bbadfbb83a6a7a2b552ee8d952
treeeb585a6eafc70c5a21dd4dc05a14a733a8724d53
parent3b9f2a149b8a0b24005e71b4ac2df5407534e744
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>
include/land.h
include/prototypes.h
src/lib/commands/expl.c
src/lib/commands/load.c
src/lib/commands/move.c
src/lib/commands/navi.c
src/lib/subs/control.c
src/lib/subs/lndsub.c
tests/navi-march/02-march-1
tests/navi-march/final.xdump
tests/navi-march/journal.log