(svn r9614) -Feature: Use the normal growth rate values when the growth rate is set to none and "Fund new buildings" is used.
authormaedhros
Thu, 12 Apr 2007 18:23:47 +0000
changeset 6951 5b4480a013e6
parent 6950 c572b218bf2f
child 6952 9fc72f4d7ec8
(svn r9614) -Feature: Use the normal growth rate values when the growth rate is set to none and "Fund new buildings" is used.
src/town_cmd.cpp
--- a/src/town_cmd.cpp	Thu Apr 12 17:24:34 2007 +0000
+++ b/src/town_cmd.cpp	Thu Apr 12 18:23:47 2007 +0000
@@ -1687,7 +1687,7 @@
 	}
 
 	CLRBIT(t->flags12, TOWN_IS_FUNDED);
-	if (_patches.town_growth_rate == 0) return;
+	if (_patches.town_growth_rate == 0 && t->fund_buildings_months == 0) return;
 
 	/** Towns are processed every TOWN_GROWTH_FREQUENCY ticks, and this is the
 	 * number of times towns are processed before a new building is built. */
@@ -1712,7 +1712,11 @@
 			return;
 	}
 
-	m >>= (_patches.town_growth_rate - 1);
+	/* Use the normal growth rate values if new buildings have been funded in
+	 * this town and the growth rate is set to none. */
+	uint growth_multiplier = _patches.town_growth_rate != 0 ? _patches.town_growth_rate - 1 : 1;
+
+	m >>= growth_multiplier;
 	if (_patches.larger_towns != 0 && (t->index % _patches.larger_towns) == 0) m /= 2;
 
 	t->growth_rate = m / (t->num_houses / 50 + 1);