Add minimum town distance patch, with minor modifications

Move implicitly added value of 20 to setting default.
Adjust setting texts.

From: https://www.tt-forums.net/viewtopic.php?p=1095146#p1095146
pull/16/head
patch-import 7 years ago committed by Jonathan G Rennison
parent 7f66d4bc6a
commit 7b88f7a290

@ -1727,6 +1727,8 @@ STR_CONFIG_SETTING_CITY_SIZE_MULTIPLIER :Initial city si
STR_CONFIG_SETTING_CITY_SIZE_MULTIPLIER_HELPTEXT :Average size of cities relative to normal towns at start of the game
STR_CONFIG_SETTING_RANDOM_ROAD_RECONSTRUCTION :Probability of random town road re-construction: {STRING2}
STR_CONFIG_SETTING_RANDOM_ROAD_RECONSTRUCTION_HELPTEXT :The probability of town roads being randomly re-constructing (0 = off, 1000 = max)
STR_CONFIG_SETTING_TOWN_MIN_DISTANCE :Minimum distance between towns: {STRING2}
STR_CONFIG_SETTING_TOWN_MIN_DISTANCE_HELPTEXT :Set the minimum distance in tiles between towns for map generation and random founding
STR_CONFIG_SETTING_LINKGRAPH_INTERVAL :Update distribution graph every {STRING2}{NBSP}day{P 0:2 "" s}
STR_CONFIG_SETTING_LINKGRAPH_INTERVAL_HELPTEXT :Time between subsequent recalculations of the link graph. Each recalculation calculates the plans for one component of the graph. That means that a value X for this setting does not mean the whole graph will be updated every X days. Only some component will. The shorter you set it the more CPU time will be necessary to calculate it. The longer you set it the longer it will take until the cargo distribution starts on new routes.

@ -1744,6 +1744,7 @@ static SettingsContainer &GetSettingsTree()
genworld->Add(new SettingEntry("economy.larger_towns"));
genworld->Add(new SettingEntry("economy.initial_city_size"));
genworld->Add(new SettingEntry("economy.town_layout"));
genworld->Add(new SettingEntry("economy.town_min_distance"));
genworld->Add(new SettingEntry("difficulty.industry_density"));
genworld->Add(new SettingEntry("gui.pause_on_newgame"));
}

@ -538,6 +538,7 @@ struct EconomySettings {
uint8 initial_city_size; ///< multiplier for the initial size of the cities compared to towns
TownLayoutByte town_layout; ///< select town layout, @see TownLayout
bool allow_town_roads; ///< towns are allowed to build roads (always allowed when generating world / in SE)
uint16 town_min_distance; ///< minimum distance between towns
TownFoundingByte found_town; ///< town founding, @see TownFounding
bool station_noise_level; ///< build new airports when the town noise level is still within accepted limits
uint16 town_noise_population[3]; ///< population to base decision on noise evaluation (@see town_council_tolerance)

@ -1743,6 +1743,19 @@ from = 77
def = true
cat = SC_EXPERT
[SDT_VAR]
base = GameSettings
var = economy.town_min_distance
type = SLE_UINT16
def = 20
min = 15
max = 500
interval = 5
str = STR_CONFIG_SETTING_TOWN_MIN_DISTANCE
strhelp = STR_CONFIG_SETTING_TOWN_MIN_DISTANCE_HELPTEXT
strval = STR_JUST_INT
patxname = ""town_min_distance.economy.town_min_distance""
[SDT_XREF]
xref = ""economy.infrastructure_sharing[0]""

@ -1800,7 +1800,7 @@ static CommandCost TownCanBePlacedHere(TileIndex tile)
}
/* Check distance to all other towns. */
if (IsCloseToTown(tile, 20)) {
if (IsCloseToTown(tile, _settings_game.economy.town_min_distance)) {
return_cmd_error(STR_ERROR_TOO_CLOSE_TO_ANOTHER_TOWN);
}

Loading…
Cancel
Save