empserver/src/lib/update
Markus Armbruster fdde783278 update: Fix income and level use after revolt or revert to deity
prepare_sects() caches the sector owner's getnatp() across
guerrilla(), do_plague() and populace().  This is wrong, because the
owner may change.  The mistake can be traced back all the way back to
BSD Empire 1.1.

If the sector revolts or reverts to deity, the ex-owner still receives
taxes and bank interest.  The update test demonstrates this bug.

If the sector revolts, we use the ex-owner's instead of the owner's
tech and research for plague, and we use the ex-owners happiness and
required happiness instead of the owner's for loyalty update and civil
unrest.

Change do_plague() and populace() to call getnatp() themselves.  Call
it in prepare_sects() only after we're done messing with the sector
owner.

Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
2017-08-06 19:59:58 +02:00
..
age.c Update copyright notice 2017-07-02 17:45:44 +02:00
anno.c Update copyright notice 2017-07-02 17:45:44 +02:00
bp.c update: Drop redundant bp_put_items() parameter vec[] 2017-08-06 19:59:57 +02:00
deliver.c Update copyright notice 2017-07-02 17:45:44 +02:00
distribute.c Update copyright notice 2017-07-02 17:45:44 +02:00
finish.c Update copyright notice 2017-07-02 17:45:44 +02:00
human.c neweff production: Consider insufficient food 2017-08-06 19:59:57 +02:00
land.c config: Generalize unit build materials storage 2017-08-06 14:05:11 +02:00
main.c update: Eliminate produce_sect()'s getnatp() 2017-08-06 19:59:56 +02:00
material.c config: Generalize unit build materials storage 2017-08-06 14:05:11 +02:00
mobility.c Update copyright notice 2017-07-02 17:45:44 +02:00
move_sat.c Update copyright notice 2017-07-02 17:45:44 +02:00
nat.c Update copyright notice 2017-07-02 17:45:44 +02:00
nxtitemp.c Update copyright notice 2017-07-02 17:45:44 +02:00
plague.c update: Fix income and level use after revolt or revert to deity 2017-08-06 19:59:58 +02:00
plane.c config: Generalize unit build materials storage 2017-08-06 14:05:11 +02:00
populace.c update: Fix income and level use after revolt or revert to deity 2017-08-06 19:59:58 +02:00
prepare.c update: Fix income and level use after revolt or revert to deity 2017-08-06 19:59:58 +02:00
produce.c update: Drop redundant produce() parameters desig, neweff 2017-08-06 19:59:57 +02:00
removewants.c Update copyright notice 2017-07-02 17:45:44 +02:00
revolt.c Update copyright notice 2017-07-02 17:45:44 +02:00
sect.c update: Fix revert to deity and "no civilians" corner cases 2017-08-06 19:59:57 +02:00
ship.c config: Generalize unit build materials storage 2017-08-06 14:05:11 +02:00