]> git.pond.sub.org Git - empserver/commit
update budget: Fix civ counting for happiness and education
authorMarkus Armbruster <armbru@pond.sub.org>
Sun, 19 Jun 2016 11:01:52 +0000 (13:01 +0200)
committerMarkus Armbruster <armbru@pond.sub.org>
Sun, 6 Aug 2017 18:08:30 +0000 (20:08 +0200)
commit14f3bd9717b6ef793ade234fdd6904eea6adde0a
treea3b282cf505cb5c694bd4547d25f8a20f07d02f4
parent6eb4fd3cbfa021f22003ea9d7a4e91f7024443de
update budget: Fix civ counting for happiness and education

Per-civilian happiness and education production is raw production
divided by the number of old-owned civilians.  The update reports the
number of old-owned civilians ("total pop was %d").

This number of civilians is also used by budget to predict cost of
tech when option TECH_POP is enabled, but that doesn't match how the
update computes the cost.  To be fixed next.

Civilians loaded on ships are only counted by the update, not by
budget.  Harmless, as budget doesn't compute happiness and education.
Civilians loaded on land units are ignored by both.  None of the stock
game's land units can load civilians.

Civilians in sectors are counted before plague deaths, and in ships
afterwards.

Fix upd_ship() and upd_land() to count civilians the same way as
prepare_sects() does for sectors.

Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
src/lib/update/land.c
src/lib/update/ship.c
tests/update/final.xdump
tests/update/journal.log