Changeset - r18469:36a3d22c84cd
[Not reviewed]
master
0 1 0
truebrain - 13 years ago 2011-11-25 11:35:15
truebrain@openttd.org
(svn r23323) -Fix: when you fund a town, it should grow; goals reached or not
1 file changed with 7 insertions and 5 deletions:
0 comments (0 inline, 0 general)
src/town_cmd.cpp
Show inline comments
 
@@ -2775,11 +2775,13 @@ static void UpdateTownGrowRate(Town *t)
 

	
 
	if (_settings_game.economy.town_growth_rate == 0 && t->fund_buildings_months == 0) return;
 

	
 
	/* Check if all goals are reached for this town to grow */
 
	for (int i = TE_BEGIN; i < TE_END; i++) {
 
		if (t->goal[i] == TOWN_GROWTH_WINTER && TileHeight(t->xy) >= GetSnowLine() && t->received[i].old_act == 0 && t->population > 90) return;
 
		if (t->goal[i] == TOWN_GROWTH_DESERT && GetTropicZone(t->xy) == TROPICZONE_DESERT && t->received[i].old_act == 0 && t->population > 60) return;
 
		if (t->goal[i] > t->received[i].old_act) return;
 
	if (t->fund_buildings_months == 0) {
 
		/* Check if all goals are reached for this town to grow (given we are not funding it) */
 
		for (int i = TE_BEGIN; i < TE_END; i++) {
 
			if (t->goal[i] == TOWN_GROWTH_WINTER && TileHeight(t->xy) >= GetSnowLine() && t->received[i].old_act == 0 && t->population > 90) return;
 
			if (t->goal[i] == TOWN_GROWTH_DESERT && GetTropicZone(t->xy) == TROPICZONE_DESERT && t->received[i].old_act == 0 && t->population > 60) return;
 
			if (t->goal[i] > t->received[i].old_act) return;
 
		}
 
	}
 

	
 
	/**
0 comments (0 inline, 0 general)