]> git.pond.sub.org Git - empserver/commit
navigate march: Fix "same mob type" and "not on sale" checks
authorMarkus Armbruster <armbru@pond.sub.org>
Mon, 5 Jan 2015 12:10:14 +0000 (13:10 +0100)
committerMarkus Armbruster <armbru@pond.sub.org>
Mon, 2 Mar 2015 07:20:47 +0000 (08:20 +0100)
commit520cfea05de5d4335b0763943eb7d90c9b9c9a2b
tree96bf7140ef107396b7eec1d8d399a22380335ae2
parent797abf4c8ffaaa6faf8a8326cbcaafc2dbf7a021
navigate march: Fix "same mob type" and "not on sale" checks

Unlike the other "may move" conditions, "same mobility type
(MOB_MARCH, MOB_RAIL) as leader" and "not on sale" are only checked
when collecting ships and land units.

The former breaks when a deity unwisely edits a land unit's type while
it is being marched.  Messed up when the check was added in commit
36e41e5 (v4.3.7).  However, editing has become possible only recently,
in commit 6b0b6f1.

The latter would break if a ship could be put on the market while it
is being navigated, but that's not possible, because only the owner
can navigate (see also commit 8c502d4), and only the owner can sell.
Same for land units.  Messed up in 4.0.9.  Clean it up anyway.  Bonus:
nicer error message, even spelled correctly.

Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
src/lib/subs/lndsub.c
src/lib/subs/shpsub.c
tests/navi-march/journal.log