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>
This commit is contained in:
parent
b7b99c95c2
commit
0bdcb5ee19
16 changed files with 3333 additions and 3332 deletions
|
@ -78,7 +78,7 @@ sct_prewrite(int id, void *old, void *new)
|
|||
own = sp->sct_own;
|
||||
prev_own = oldsp->sct_own;
|
||||
|
||||
if (own && !civs) {
|
||||
if (!civs) {
|
||||
sp->sct_work = 100;
|
||||
sp->sct_oldown = own;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue