(max_population): Deal gracefully with big city 10 * d_maxpop >

ITEM_MAX: let value grow linearly from d_maxpop at 0% to the minimum
of 10 * d_maxpop and ITEM_MAX at 100%.
This commit is contained in:
Markus Armbruster 2006-06-13 17:46:04 +00:00
parent d22cb495bc
commit be430d4b9d

View file

@ -46,11 +46,13 @@ int
max_population(float research, int desig, int eff) max_population(float research, int desig, int eff)
{ {
int maxpop = dchr[desig].d_maxpop; int maxpop = dchr[desig].d_maxpop;
int rmax; int mp100, rmax;
/* city efficiency limits maximum population */ /* city efficiency limits maximum population */
if (IS_BIG_CITY(desig)) if (IS_BIG_CITY(desig)) {
maxpop *= 1 + 9.0 * eff / 100; mp100 = MIN(ITEM_MAX, 10 * maxpop);
maxpop += (mp100 - maxpop) * eff / 100.0;
}
if (opt_RES_POP) { if (opt_RES_POP) {
/* research limits maximum population */ /* research limits maximum population */