]> git.pond.sub.org Git - empserver/commit
sect: Keep work percentage without civilians at 100%
authorMarkus Armbruster <armbru@pond.sub.org>
Sat, 4 Jun 2016 12:32:58 +0000 (14:32 +0200)
committerMarkus Armbruster <armbru@pond.sub.org>
Sun, 6 Aug 2017 17:59:57 +0000 (19:59 +0200)
commit0bdcb5ee19fa2946cdb7dbe4d41855aaef559385
tree484a41585bbaf5b5f532f00d6b28479350cda564
parentb7b99c95c2b1063e13370219e0f1e5ec5cf30dfc
sect: Keep work percentage without civilians at 100%

We maintain a few sector invariants in sct_prewrite().  Since the
update bypasses sct_prewrite(), it needs to maintain them itself.  The
two should be consistent.

sct_prewrite() resets work percentage of owned sectors to 100% when
there are no civilians.  The update's populace() resets it for unowned
sectors as well, if they have military.

Change sct_prewrite() to reset sct_work = 100 regardless of owner.
Also change sct_oninit() to initialize sct_work = 100, so it doesn't
change on first write.  Update tests/smoke/fairland.xdump for the same
reason.

The massive test output differences are all due to sct_work.

Inconsistencies with the update remain.  They will be fixed next.

Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
16 files changed:
src/lib/common/filetable.c
src/lib/subs/sect.c
tests/actofgod/final.xdump
tests/bridgefall/final.xdump
tests/bridgefall/journal.log
tests/build/final.xdump
tests/build/journal.log
tests/fairland/final.xdump
tests/fire/final.xdump
tests/fire/journal.log
tests/navi-march/final.xdump
tests/retreat/final.xdump
tests/smoke/fairland.xdump
tests/smoke/final.xdump
tests/torpedo/final.xdump
tests/update/final.xdump