]> git.pond.sub.org Git - empserver/commit - src/lib/commands/scra.c
build scrap: Redo 4.2.3's fix for manufacturing military
authorMarkus Armbruster <armbru@pond.sub.org>
Sun, 12 Jan 2014 17:40:45 +0000 (18:40 +0100)
committerMarkus Armbruster <armbru@pond.sub.org>
Sun, 16 Feb 2014 10:48:34 +0000 (11:48 +0100)
commiteeb62ab2805321723a82a71918517322905883a3
tree78b5c7b167ce55ee5a6ab30916beace7522c2d0d
parente2d176fd8a5f7420bcf9ed8ec105aa22d95eb2e5
build scrap: Redo 4.2.3's fix for manufacturing military

scrap has always returned the scrapped planes' full crew, regardless
of efficiency.  build, however, charged only 10%.  If you built ten
planes with one crew each, you used up one military.  Or none, if you
abused random rounding.  If you scrapped them again, you got ten back.
Pretty pricey way to manufacture military, but wrong all the same.

4.2.3 plugged this hole by making build never round military to zero.
Ugly special case, and not documented.  Also doesn't prevent abuse of
random rounding for planes requiring more than 10 crew, but such
planes don't exist in the stock game.

Redo this fix:

1. Make scrap return crew proportional to efficiency, randomly
rounded.  Note that scrap returns only two thirds of the other
materials, rounded down.  Recycling materials isn't perfect, but
recycling aircrew is.

2. Drop the special case from build: treat military just like other
materials.

Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
src/lib/commands/buil.c
src/lib/commands/scra.c
tests/build/final.xdump
tests/build/journal.log
tests/smoke/final.xdump
tests/smoke/journal.log