diff --git a/src/lang/english.txt b/src/lang/english.txt index bf5482aafd..e871cb4572 100644 --- a/src/lang/english.txt +++ b/src/lang/english.txt @@ -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. diff --git a/src/settings_gui.cpp b/src/settings_gui.cpp index bf6cb3706c..d90a5b6864 100644 --- a/src/settings_gui.cpp +++ b/src/settings_gui.cpp @@ -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")); } diff --git a/src/settings_type.h b/src/settings_type.h index 316118898a..372ec8a267 100644 --- a/src/settings_type.h +++ b/src/settings_type.h @@ -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) diff --git a/src/table/settings.ini b/src/table/settings.ini index 89e496a61e..35d84f781d 100644 --- a/src/table/settings.ini +++ b/src/table/settings.ini @@ -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]"" diff --git a/src/town_cmd.cpp b/src/town_cmd.cpp index cea6536b32..9ada8b1425 100644 --- a/src/town_cmd.cpp +++ b/src/town_cmd.cpp @@ -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); }