Changeset - r11285:c5f6443608b0
[Not reviewed]
master
0 2 0
yexo - 15 years ago 2009-03-07 21:36:13
yexo@openttd.org
(svn r15639) -Change: When you disable "Towns are allowed to build roads", pressing "Expand" in the town window in the scenario editor will no longer build roads.
2 files changed with 10 insertions and 4 deletions:
0 comments (0 inline, 0 general)
src/lang/english.txt
Show inline comments
 
@@ -603,12 +603,13 @@ STR_0238_TOO_CLOSE_TO_ANOTHER_TOWN      
 
STR_0239_SITE_UNSUITABLE                                        :{WHITE}...site unsuitable
 
STR_023A_TOO_MANY_TOWNS                                         :{WHITE}...too many towns
 
STR_CANNOT_GENERATE_TOWN                                        :{WHITE}Can't build any towns
 
STR_NO_SPACE_FOR_TOWN                                           :{WHITE}...there is no more space on the map
 
STR_023B_INCREASE_SIZE_OF_TOWN                                  :{BLACK}Increase size of town
 
STR_023C_EXPAND                                                 :{BLACK}Expand
 
STR_TOWN_EXPAND_WARN_NO_ROADS                                   :{WHITE}The town will not build roads. You can enable building of roads via Advanced Settings->Economy->Towns.
 
STR_023D_RANDOM_TOWN                                            :{BLACK}Random Town
 
STR_023E_BUILD_TOWN_IN_RANDOM_LOCATION                          :{BLACK}Build town in random location
 
STR_0285_CAN_T_BUILD_HERE                                       :{WHITE}Can't build {STRING} here...
 
STR_0286_MUST_BUILD_TOWN_FIRST                                  :{WHITE}...must build town first
 
STR_0287_ONLY_ONE_ALLOWED_PER_TOWN                              :{WHITE}...only one allowed per town
 
STR_0288_PLANT_TREES                                            :{BLACK}Plant trees
src/town_cmd.cpp
Show inline comments
 
@@ -1978,13 +1978,13 @@ static bool BuildTownHouse(Town *t, Tile
 
		if (_loaded_newgrf_features.has_newhouses) {
 
			if (hs->override != 0) {
 
				house = hs->override;
 
				hs = GetHouseSpecs(house);
 
			}
 

	
 
			if ((hs->extra_flags & BUILDING_IS_HISTORICAL) && !_generating_world) continue;
 
			if ((hs->extra_flags & BUILDING_IS_HISTORICAL) && !_generating_world && _game_mode != GM_EDITOR) continue;
 
		}
 

	
 
		if (_cur_year < hs->min_year || _cur_year > hs->max_year) continue;
 

	
 
		/* Special houses that there can be only one of. */
 
		uint oneof = 0;
 
@@ -2022,13 +2022,13 @@ static bool BuildTownHouse(Town *t, Tile
 
		/* Special houses that there can be only one of. */
 
		t->flags12 |= oneof;
 

	
 
		byte construction_counter = 0;
 
		byte construction_stage = 0;
 

	
 
		if (_generating_world) {
 
		if (_generating_world || _game_mode == GM_EDITOR) {
 
			uint32 r = Random();
 

	
 
			construction_stage = TOWN_HOUSE_COMPLETED;
 
			if (Chance16(1, 7)) construction_stage = GB(r, 0, 2);
 

	
 
			if (construction_stage == TOWN_HOUSE_COMPLETED) {
 
@@ -2163,13 +2163,19 @@ CommandCost CmdRenameTown(TileIndex tile
 
	return CommandCost();
 
}
 

	
 
/** Called from GUI */
 
void ExpandTown(Town *t)
 
{
 
	_generating_world = true;
 
	/* Warn the users if towns are not allowed to build roads,
 
	 * but do this only onces per openttd run. */
 
	static bool warned_no_roads = false;
 
	if (!_settings_game.economy.allow_town_roads && !warned_no_roads) {
 
		ShowErrorMessage(INVALID_STRING_ID, STR_TOWN_EXPAND_WARN_NO_ROADS, 0, 0);
 
		warned_no_roads = true;
 
	}
 

	
 
	/* The more houses, the faster we grow */
 
	uint amount = RandomRange(ClampToU16(t->num_houses / 10)) + 3;
 
	t->num_houses += amount;
 
	UpdateTownRadius(t);
 

	
 
@@ -2177,13 +2183,12 @@ void ExpandTown(Town *t)
 
	do GrowTown(t); while (--n);
 

	
 
	t->num_houses -= amount;
 
	UpdateTownRadius(t);
 

	
 
	UpdateTownMaxPass(t);
 
	_generating_world = false;
 
}
 

	
 
extern const byte _town_action_costs[8] = {
 
	2, 4, 9, 35, 48, 53, 117, 175
 
};
 

	
0 comments (0 inline, 0 general)