(PRI_SMAINT, PRI_PMAINT, PRI_LMAINT, PRI_SBUILD, PRI_PBUILD,

PRI_LBUILD): Turn macros into enumeration constants.  Value
SCT_MAXDEF+1 was previously unused; use it.
(PRI_MAX): New; replacing the horrible SCT_MAXDEF+8.

(show_sect_build): Simply examine all sector types, don't skip the
first five.  The code ignores them just fine.

(show_sect_build, show_sect_stats, show_sect_capab): Don't try to show
sector types beyond SCT_MAXDEF.  The table has some empty extra slots,
for whatever reasons; no use examining them.
This commit is contained in:
Markus Armbruster 2004-08-19 16:59:36 +00:00
parent cff2deba4a
commit 0ebb14c8be
6 changed files with 30 additions and 27 deletions

View file

@ -112,7 +112,7 @@ update_main(void *unused)
logerror("producing for countries...");
for (x = 0; x < MAXNOC; x++) {
int y, z, sb = 0, sm = 0, pb = 0, pm = 0, lm = 0, lb = 0;
long p_sect[SCT_MAXDEF + 1][2];
long p_sect[SCT_MAXDEF+1][2];
memset(p_sect, 0, sizeof(p_sect));
mil_dbl_pay = 0;
@ -126,8 +126,8 @@ update_main(void *unused)
}
np->nat_money += (int)(np->nat_reserve * money_res * etu);
for (y = 1; y < SCT_MAXDEF + 8; y++) {
for (z = 0; z < SCT_MAXDEF + 8; z++) {
for (y = 1; y <= PRI_MAX; y++) {
for (z = 0; z <= PRI_MAX; z++) {
if (np->nat_priorities[z] == y) {
do_prod(z, etu, x, bp, p_sect,
&sb, &sm, &pb, &pm, &lb, &lm);