Changeset - r21950:a3c25b7da6f3
[Not reviewed]
master
0 2 0
rubidium - 10 years ago 2015-01-01 21:25:42
rubidium@openttd.org
(svn r27105) -Fix [FS#6195]: grow_counter was not properly bounded by growth_rate, but by some other value used to calculate growth_rate.
2 files changed with 2 insertions and 4 deletions:
0 comments (0 inline, 0 general)
src/town.h
Show inline comments
 
@@ -91,7 +91,7 @@ struct Town : TownPool::PoolItem<&_town_
 

	
 
	uint16 time_until_rebuild;     ///< time until we rebuild a house
 

	
 
	uint16 grow_counter;           ///< counter to count when to grow
 
	uint16 grow_counter;           ///< counter to count when to grow, value is smaller than or equal to growth_rate
 
	uint16 growth_rate;            ///< town growth rate
 

	
 
	byte fund_buildings_months;    ///< fund buildings program in action?
src/town_cmd.cpp
Show inline comments
 
@@ -3115,9 +3115,7 @@ static void UpdateTownGrowRate(Town *t)
 
	if (t->larger_town) m /= 2;
 

	
 
	t->growth_rate = m / (t->cache.num_houses / 50 + 1);
 
	if (m <= t->grow_counter) {
 
		t->grow_counter = m;
 
	}
 
	t->grow_counter = min(t->growth_rate, t->grow_counter);
 

	
 
	SetBit(t->flags, TOWN_IS_GROWING);
 
	SetWindowDirty(WC_TOWN_VIEW, t->index);
0 comments (0 inline, 0 general)