(max_population): New, factored out of max_pop().

(max_pop): Use it.  Don't support null argument anymore.
(nati, gen_power): Use max_population() instead of max_pop() with null
argument.
(show_sect_stats): Use max_population() to simplify the code.
(prod, upd_buildeff): Use max_population() to get correct new maximum
population for limiting work when tearing down a big city.
Previously, this was broken in upd_buildeff().  In prod(), it was
broken when the new designation had odd maximum population, which
should not occur.
This commit is contained in:
Markus Armbruster 2005-02-17 21:04:08 +00:00
parent f8b2860ec5
commit ff67d93711
7 changed files with 20 additions and 14 deletions

View file

@ -655,12 +655,9 @@ void
show_sect_stats(int foo)
{
int x, first = 1;
struct sctstr sect;
struct natstr *natp;
natp = getnatp(player->cnum);
/* We fake this */
sect.sct_effic = 100;
for (x = 0; x <= SCT_MAXDEF; x++) {
if (dchr[x].d_mnem == 0)
continue;
@ -669,7 +666,6 @@ show_sect_stats(int foo)
pr(" sector type mcost off def mil uw civ bar other pop\n");
first = 0;
}
sect.sct_type = x;
pr("%c %-23s %3d %5.2f %5.2f %3d %3d %3d %3d %5d %5d\n",
dchr[x].d_mnem, dchr[x].d_name,
dchr[x].d_mcst, dchr[x].d_ostr,
@ -679,7 +675,7 @@ show_sect_stats(int foo)
ichr[I_CIVIL].i_pkg[dchr[x].d_pkg],
ichr[I_BAR].i_pkg[dchr[x].d_pkg],
ichr[I_LCM].i_pkg[dchr[x].d_pkg],
max_pop(natp->nat_level[NAT_RLEV], &sect));
max_population(natp->nat_level[NAT_RLEV], x, 100));
}
}