]> git.pond.sub.org Git - empserver/commit
budget: Fix for ship, plane, land unit building abroad
authorMarkus Armbruster <armbru@pond.sub.org>
Sun, 10 Jul 2016 19:15:15 +0000 (21:15 +0200)
committerMarkus Armbruster <armbru@pond.sub.org>
Sun, 6 Aug 2017 18:08:30 +0000 (20:08 +0200)
commit70f69640e110f325b0c2b186ec10866a21ca6c9e
tree1ebf7a6e3642e59e8f9cae5731f3189454bd6a1e
parent459dec0af0e12bc7b49a7bceb20124b03a413d50
budget: Fix for ship, plane, land unit building abroad

The budget command simulates an update by running selected parts of
the update code.  It skips parts that depend on hidden information
such as guerrilla warfare.  For speed, it also skips parts it doesn't
need, such as distribution and foreign sectors, ships, planes and land
units.

Skipping foreign sectors is wrong when any of the player's ships,
planes or land units will be repaired in foreign sectors, because it
makes budget use old materials and work instead of new.

Skipping foreign ships, planes and land units is wrong when they
compete with the player's for materials and work.

The bug goes back to Chainsaw's option BUDGET.  See the previous
commit for more detailed historical notes.  The update test
demonstrates it in several variations.

Fix it with the sledgehammer: don't skip foreign sectors, ships,
planes and land units.  This makes budget almost twenty times slower
in my testing.  Probably tolerable on a reasonably beefy machine, but
we can do better; the next few commits will claw back most of the lost
performance.

Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
include/update.h
src/lib/commands/budg.c
src/lib/update/main.c
src/lib/update/prepare.c
src/lib/update/sect.c
tests/update/01-1
tests/update/06-6
tests/update/journal.log