(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

@ -87,7 +87,7 @@ upd_buildeff(struct natstr *np, struct sctstr *sp, int *workp,
if (opt_BIG_CITY) {
if (!n && dchr[old_type].d_pkg == UPKG &&
dchr[*desig].d_pkg != UPKG) {
int maxpop = max_pop(np->nat_level[NAT_RLEV], sp);
int maxpop = max_population(np->nat_level[NAT_RLEV], *desig, n);
if (vec[I_CIVIL] > maxpop)
vec[I_CIVIL] = maxpop;
if (vec[I_UW] > maxpop)