diff --git a/src/lang/extra/english.txt b/src/lang/extra/english.txt index 3cc0b2661f..a6a06d8e70 100644 --- a/src/lang/extra/english.txt +++ b/src/lang/extra/english.txt @@ -706,6 +706,9 @@ STR_CONFIG_SETTING_NO_EXPIRE_OBJECTS_AFTER_ZERO :Off STR_CONFIG_SETTING_IGNORE_OBJECT_INTRO_DATES :Ignore object introduction dates: {STRING2} STR_CONFIG_SETTING_IGNORE_OBJECT_INTRO_DATES_HELPTEXT :Set whether players are allowed to build objects before their introduction date.{}Does not apply to objects constructed during map generation. +STR_CONFIG_SETTING_ALLOW_CONVERT_TOWN_ROAD_NO_HOUSES :Allow converting town roads to non-house types: {STRING2} +STR_CONFIG_SETTING_ALLOW_CONVERT_TOWN_ROAD_NO_HOUSES_HELPTEXT :Whether to allow players to convert town-owned roads to a road type which does not allow houses.{}This is off by default because doing so can prevent towns from building houses at all, resulting in them shrinking. + STR_PURCHASE_LAND_PERMITTED_NO :No STR_PURCHASE_LAND_PERMITTED_SINGLE :Yes, 1 tile at a time STR_PURCHASE_LAND_PERMITTED_AREA :Yes, large areas at a time diff --git a/src/road_cmd.cpp b/src/road_cmd.cpp index 2d76ea5819..6863a74751 100644 --- a/src/road_cmd.cpp +++ b/src/road_cmd.cpp @@ -3117,8 +3117,9 @@ CommandCost CmdConvertRoad(TileIndex tile, DoCommandFlag flags, uint32 p1, uint3 } } - /* Disallow converting town roads to types which do not allow houses */ - if (rtt == RTT_ROAD && owner == OWNER_TOWN && HasBit(GetRoadTypeInfo(to_type)->flags, ROTF_NO_HOUSES)) { + /* Disallow converting town roads to types which do not allow houses, unless this is allowed */ + if (rtt == RTT_ROAD && owner == OWNER_TOWN && HasBit(GetRoadTypeInfo(to_type)->flags, ROTF_NO_HOUSES) + && !_settings_game.construction.convert_town_road_no_houses) { error.MakeError(STR_ERROR_OWNED_BY); GetNameOfOwner(OWNER_TOWN, tile); continue; diff --git a/src/settings_gui.cpp b/src/settings_gui.cpp index bae6eb40fc..6e0ea281c0 100644 --- a/src/settings_gui.cpp +++ b/src/settings_gui.cpp @@ -2296,6 +2296,7 @@ static SettingsContainer &GetSettingsTree() limitations->Add(new SettingEntry("station.distant_join_stations")); limitations->Add(new SettingEntry("construction.road_stop_on_town_road")); limitations->Add(new SettingEntry("construction.road_stop_on_competitor_road")); + limitations->Add(new SettingEntry("construction.convert_town_road_no_houses")); limitations->Add(new SettingEntry("vehicle.disable_elrails")); limitations->Add(new SettingEntry("construction.maximum_signal_evaluations")); limitations->Add(new SettingEntry("construction.enable_build_river")); diff --git a/src/settings_type.h b/src/settings_type.h index 8dbc231a22..1fe393c37a 100644 --- a/src/settings_type.h +++ b/src/settings_type.h @@ -496,6 +496,7 @@ struct ConstructionSettings { bool build_object_area_permitted; ///< whether building objects by area is permitted Year no_expire_objects_after; ///< do not expire objects after this year bool ignore_object_intro_dates; ///< allow players to build objects before their introduction dates (does not include during map generation) + bool convert_town_road_no_houses; ///< allow converting town roads to a type which does not allow houses uint32 terraform_per_64k_frames; ///< how many tile heights may, over a long period, be terraformed per 65536 frames? uint16 terraform_frame_burst; ///< how many tile heights may, over a short period, be terraformed? diff --git a/src/table/settings/settings.ini b/src/table/settings/settings.ini index 49e950f813..8cbf82f230 100644 --- a/src/table/settings/settings.ini +++ b/src/table/settings/settings.ini @@ -2221,6 +2221,14 @@ strhelp = STR_CONFIG_SETTING_IGNORE_OBJECT_INTRO_DATES_HELPTEXT patxname = ""construction.ignore_object_intro_dates"" post_cb = [](auto) { InvalidateWindowClassesData(WC_BUILD_OBJECT, 0); } +[SDT_BOOL] +var = construction.convert_town_road_no_houses +def = false +str = STR_CONFIG_SETTING_ALLOW_CONVERT_TOWN_ROAD_NO_HOUSES +strhelp = STR_CONFIG_SETTING_ALLOW_CONVERT_TOWN_ROAD_NO_HOUSES_HELPTEXT +cat = SC_EXPERT +patxname = ""construction.convert_town_road_no_houses"" + [SDT_BOOL] var = station.adjacent_stations from = SLV_62