diff --git a/src/lang/english.txt b/src/lang/english.txt index 41986ec94b..8e823b0921 100644 --- a/src/lang/english.txt +++ b/src/lang/english.txt @@ -1722,6 +1722,8 @@ STR_CONFIG_SETTING_LARGER_TOWNS_VALUE :1 in {COMMA} STR_CONFIG_SETTING_LARGER_TOWNS_DISABLED :None STR_CONFIG_SETTING_CITY_SIZE_MULTIPLIER :Initial city size multiplier: {STRING2} 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_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/road_cmd.cpp b/src/road_cmd.cpp index 6564ea355e..2e14cda517 100644 --- a/src/road_cmd.cpp +++ b/src/road_cmd.cpp @@ -1522,7 +1522,7 @@ static void TileLoop_Road(TileIndex tile) grp = GetTownRadiusGroup(t, tile); /* Show an animation to indicate road work */ - if (t->road_build_months != 0 && + if ((t->road_build_months != 0 || Chance16(_settings_game.economy.random_road_reconstruction, 1000)) && (DistanceManhattan(t->xy, tile) < 8 || grp != HZB_TOWN_EDGE) && IsNormalRoad(tile) && !HasAtMostOneBit(GetAllRoadBits(tile))) { if (GetFoundationSlope(tile) == SLOPE_FLAT && EnsureNoVehicleOnGround(tile).Succeeded() && Chance16(1, 40)) { diff --git a/src/settings_gui.cpp b/src/settings_gui.cpp index a73602402e..a536d94bee 100644 --- a/src/settings_gui.cpp +++ b/src/settings_gui.cpp @@ -1766,6 +1766,7 @@ static SettingsContainer &GetSettingsTree() towns->Add(new SettingEntry("economy.allow_town_level_crossings")); towns->Add(new SettingEntry("economy.found_town")); towns->Add(new SettingEntry("economy.town_cargo_factor")); + towns->Add(new SettingEntry("economy.random_road_reconstruction")); } SettingsPage *industries = environment->Add(new SettingsPage(STR_CONFIG_SETTING_ENVIRONMENT_INDUSTRIES)); diff --git a/src/settings_type.h b/src/settings_type.h index 00d7efce34..e827b1a311 100644 --- a/src/settings_type.h +++ b/src/settings_type.h @@ -547,6 +547,7 @@ struct EconomySettings { int8 town_cargo_factor; ///< power-of-two multiplier for town (passenger, mail) generation. May be negative. bool infrastructure_maintenance; ///< enable monthly maintenance fee for owner infrastructure uint8 day_length_factor; ///< factor which the length of day is multiplied + uint16 random_road_reconstruction; ///< chance out of 1000 per tile loop for towns to start random road re-construction }; struct LinkGraphSettings { diff --git a/src/table/settings.ini b/src/table/settings.ini index dc011a20f1..f43c53237c 100644 --- a/src/table/settings.ini +++ b/src/table/settings.ini @@ -2013,6 +2013,19 @@ strhelp = STR_CONFIG_SETTING_INFRASTRUCTURE_MAINTENANCE_HELPTEXT proc = InvalidateCompanyInfrastructureWindow cat = SC_BASIC +[SDT_VAR] +base = GameSettings +var = economy.random_road_reconstruction +type = SLE_UINT16 +def = 0 +min = 0 +max = 1000 +str = STR_CONFIG_SETTING_RANDOM_ROAD_RECONSTRUCTION +strhelp = STR_CONFIG_SETTING_RANDOM_ROAD_RECONSTRUCTION_HELPTEXT +strval = STR_JUST_COMMA +cat = SC_BASIC +patxname = ""economy.random_road_reconstruction"" + ## [SDT_VAR] base = GameSettings