]> git.pond.sub.org Git - empserver/commit
budget: Fix military count (but not yet their pay)
authorMarkus Armbruster <armbru@pond.sub.org>
Sat, 18 Jun 2016 12:57:45 +0000 (14:57 +0200)
committerMarkus Armbruster <armbru@pond.sub.org>
Sun, 6 Aug 2017 17:59:59 +0000 (19:59 +0200)
commitbb495cac6088a7c167f4db7335d9b32365070153
treed513f3a75a77ba5b5cbc4d20ed56f6f0022ee28e
parent35d2671c7190dd553e148ab9ce7d11b86b5df6be
budget: Fix military count (but not yet their pay)

When we add up military payroll, we discard fractions.  Payroll is
therefore lower than it should be, but I'm not fixing that now.  The
number of military budget reports is actually computed from payroll,
and therefore also low.

The obvious way to fix that would be adding another out parameter to
tax() and upd_slmilcosts().  However, budget and the update track cost
and count of numerous things (sector products, unit maintenance and
building, ...), and it's time for a common way to do that.

Create struct budget_item for tracking cost and count, and struct
budget nat_budget[MAXNOC] for tracking a nation's budget.  Track only
military for now; more to follow.

This fixes the military count.  The cost of military remains low,
because we discard fractions exactly as before.

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
tests/update/02-2
tests/update/journal.log