]> git.pond.sub.org Git - empserver/commit
budget: Track sector expenses in nat_budget[]
authorMarkus Armbruster <armbru@pond.sub.org>
Sat, 18 Jun 2016 13:33:05 +0000 (15:33 +0200)
committerMarkus Armbruster <armbru@pond.sub.org>
Sun, 6 Aug 2017 18:00:00 +0000 (20:00 +0200)
commit16f9a393c4fb10dc8b6031bed992f4fc55f1dc26
tree5bba159eff3b29d8fcfd40d14d88bafdef30ae7a
parentbb495cac6088a7c167f4db7335d9b32365070153
budget: Track sector expenses in nat_budget[]

The update summarizes sector production, building and maintenance for
budget in a two-dimensional array int p_sect[SCT_BUDG_MAX+1][2].  All
references into this array use literals as second subscript.  Bzzzt,
wrong data type.

Add two one-dimensional arrays to nat_budget[], one for production,
and one for building and maintenance.  p_sect[i] becomes
nat_budget[cnum].prod[i] for production, and .bm[j] for building and
maintenance.  p_sect[i][0] becomes .count, and -p_sect[i][1] becomes
.money.

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/sect.c