Changeset - r20878:f8e3794f90de
[Not reviewed]
master
0 3 0
frosch - 11 years ago 2013-10-28 10:55:34
frosch@openttd.org
(svn r25922) -Codechange: Rename TOWN_IS_FUNDED to TOWN_IS_GROWING. It is not tied to funding a town.
3 files changed with 8 insertions and 8 deletions:
0 comments (0 inline, 0 general)
src/town.h
Show inline comments
 
@@ -161,7 +161,7 @@ enum TownRatingCheckType {
 
 * And there are 5 more bits available on flags...
 
 */
 
enum TownFlags {
 
	TOWN_IS_FUNDED      = 0,   ///< Town has received some funds for
 
	TOWN_IS_GROWING     = 0,   ///< Conditions for town growth are met. Grow according to Town::growth_rate.
 
	TOWN_HAS_CHURCH     = 1,   ///< There can be only one church by town.
 
	TOWN_HAS_STADIUM    = 2,   ///< There can be only one stadium by town.
 
};
src/town_cmd.cpp
Show inline comments
 
@@ -510,7 +510,7 @@ static void TileLoop_Town(TileIndex tile
 
	Backup<CompanyByte> cur_company(_current_company, OWNER_TOWN, FILE_LINE);
 

	
 
	if ((hs->building_flags & BUILDING_HAS_1_TILE) &&
 
			HasBit(t->flags, TOWN_IS_FUNDED) &&
 
			HasBit(t->flags, TOWN_IS_GROWING) &&
 
			CanDeleteHouse(tile) &&
 
			GetHouseAge(tile) >= hs->minimum_life &&
 
			--t->time_until_rebuild == 0) {
 
@@ -758,7 +758,7 @@ static bool GrowTown(Town *t);
 

	
 
static void TownTickHandler(Town *t)
 
{
 
	if (HasBit(t->flags, TOWN_IS_FUNDED)) {
 
	if (HasBit(t->flags, TOWN_IS_GROWING)) {
 
		int i = t->grow_counter - 1;
 
		if (i < 0) {
 
			if (GrowTown(t)) {
 
@@ -2814,7 +2814,7 @@ static CommandCost TownActionFundBuildin
 
		/* Build next tick */
 
		t->grow_counter = 1;
 
		/* If we were not already growing */
 
		SetBit(t->flags, TOWN_IS_FUNDED);
 
		SetBit(t->flags, TOWN_IS_GROWING);
 
		/* And grow for 3 months */
 
		t->fund_buildings_months = 3;
 

	
 
@@ -3012,7 +3012,7 @@ static void UpdateTownRating(Town *t)
 

	
 
static void UpdateTownGrowRate(Town *t)
 
{
 
	ClrBit(t->flags, TOWN_IS_FUNDED);
 
	ClrBit(t->flags, TOWN_IS_GROWING);
 
	SetWindowDirty(WC_TOWN_VIEW, t->index);
 

	
 
	if (_settings_game.economy.town_growth_rate == 0 && t->fund_buildings_months == 0) return;
 
@@ -3035,7 +3035,7 @@ static void UpdateTownGrowRate(Town *t)
 
	}
 

	
 
	if ((t->growth_rate & TOWN_GROW_RATE_CUSTOM) != 0) {
 
		SetBit(t->flags, TOWN_IS_FUNDED);
 
		SetBit(t->flags, TOWN_IS_GROWING);
 
		SetWindowDirty(WC_TOWN_VIEW, t->index);
 
		return;
 
	}
 
@@ -3081,7 +3081,7 @@ static void UpdateTownGrowRate(Town *t)
 
		t->grow_counter = m;
 
	}
 

	
 
	SetBit(t->flags, TOWN_IS_FUNDED);
 
	SetBit(t->flags, TOWN_IS_GROWING);
 
	SetWindowDirty(WC_TOWN_VIEW, t->index);
 
}
 

	
src/town_gui.cpp
Show inline comments
 
@@ -388,7 +388,7 @@ public:
 
			DrawString(cargo_text_left, cargo_text_right, y += FONT_HEIGHT_NORMAL, string);
 
		}
 

	
 
		if (HasBit(this->town->flags, TOWN_IS_FUNDED)) {
 
		if (HasBit(this->town->flags, TOWN_IS_GROWING)) {
 
			SetDParam(0, ((this->town->growth_rate & (~TOWN_GROW_RATE_CUSTOM)) * TOWN_GROWTH_TICKS + DAY_TICKS) / DAY_TICKS);
 
			DrawString(r.left + WD_FRAMERECT_LEFT, r.right - WD_FRAMERECT_LEFT, y += FONT_HEIGHT_NORMAL, this->town->fund_buildings_months == 0 ? STR_TOWN_VIEW_TOWN_GROWS_EVERY : STR_TOWN_VIEW_TOWN_GROWS_EVERY_FUNDED);
 
		} else {
0 comments (0 inline, 0 general)