src/town_cmd.cpp
changeset 6951 5b4480a013e6
parent 6950 c572b218bf2f
child 6980 6b5dee376733
equal deleted inserted replaced
6950:c572b218bf2f 6951:5b4480a013e6
  1685 			}
  1685 			}
  1686 		}
  1686 		}
  1687 	}
  1687 	}
  1688 
  1688 
  1689 	CLRBIT(t->flags12, TOWN_IS_FUNDED);
  1689 	CLRBIT(t->flags12, TOWN_IS_FUNDED);
  1690 	if (_patches.town_growth_rate == 0) return;
  1690 	if (_patches.town_growth_rate == 0 && t->fund_buildings_months == 0) return;
  1691 
  1691 
  1692 	/** Towns are processed every TOWN_GROWTH_FREQUENCY ticks, and this is the
  1692 	/** Towns are processed every TOWN_GROWTH_FREQUENCY ticks, and this is the
  1693 	 * number of times towns are processed before a new building is built. */
  1693 	 * number of times towns are processed before a new building is built. */
  1694 	static const uint16 _grow_count_values[2][6] = {
  1694 	static const uint16 _grow_count_values[2][6] = {
  1695 		{ 120, 120, 120, 100,  80,  60 }, ///< Fund new buildings has been activated
  1695 		{ 120, 120, 120, 100,  80,  60 }, ///< Fund new buildings has been activated
  1710 	} else if (_opt.landscape == LT_TROPIC) {
  1710 	} else if (_opt.landscape == LT_TROPIC) {
  1711 		if (GetTropicZone(t->xy) == TROPICZONE_DESERT && (t->act_food==0 || t->act_water==0) && t->population > 60)
  1711 		if (GetTropicZone(t->xy) == TROPICZONE_DESERT && (t->act_food==0 || t->act_water==0) && t->population > 60)
  1712 			return;
  1712 			return;
  1713 	}
  1713 	}
  1714 
  1714 
  1715 	m >>= (_patches.town_growth_rate - 1);
  1715 	/* Use the normal growth rate values if new buildings have been funded in
       
  1716 	 * this town and the growth rate is set to none. */
       
  1717 	uint growth_multiplier = _patches.town_growth_rate != 0 ? _patches.town_growth_rate - 1 : 1;
       
  1718 
       
  1719 	m >>= growth_multiplier;
  1716 	if (_patches.larger_towns != 0 && (t->index % _patches.larger_towns) == 0) m /= 2;
  1720 	if (_patches.larger_towns != 0 && (t->index % _patches.larger_towns) == 0) m /= 2;
  1717 
  1721 
  1718 	t->growth_rate = m / (t->num_houses / 50 + 1);
  1722 	t->growth_rate = m / (t->num_houses / 50 + 1);
  1719 	if (m <= t->grow_counter)
  1723 	if (m <= t->grow_counter)
  1720 		t->grow_counter = m;
  1724 		t->grow_counter = m;