]> git.pond.sub.org Git - empserver/commit
march: Fix check for sector abandonment
authorMarkus Armbruster <armbru@pond.sub.org>
Sat, 14 May 2016 20:00:36 +0000 (22:00 +0200)
committerMarkus Armbruster <armbru@pond.sub.org>
Sun, 6 Aug 2017 11:59:32 +0000 (13:59 +0200)
commit7224442533777e441203a9c576cf6d1037aa65a7
tree077570c79edff427b95d283928b06bfb30382fe5
parentbd9fbca9954990020898b9646631162f89f5e861
march: Fix check for sector abandonment

sct_prewrite() makes an owned sector revert to the deity when there
are no civilians, military or own land units.

would_abandon() tries to predict that, but gets it wrong: it ignores
land units that evade spy detection or are loaded on ships, and it
fails to ignore land units loaded on land units marching out.

Broken in commit 7c1b166, v4.3.33.  Fix by counting manually rather
than with unitsatxy().

Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
src/lib/subs/control.c
src/lib/subs/lndsub.c
src/lib/subs/sect.c