diff --git a/src/lang/english.txt b/src/lang/english.txt index 83b6591f6e..55ea34bae0 100644 --- a/src/lang/english.txt +++ b/src/lang/english.txt @@ -1701,6 +1701,9 @@ STR_CONFIG_SETTING_PATHFINDER_FOR_SHIPS_HELPTEXT :Path finder to STR_CONFIG_SETTING_REVERSE_AT_SIGNALS :Automatic reversing at signals: {STRING2} STR_CONFIG_SETTING_REVERSE_AT_SIGNALS_HELPTEXT :Allow trains to reverse on a signal, if they waited there a long time +STR_CONFIG_SETTING_ENABLE_ROAD_CUSTOM_BRIDGE_HEADS :Enable road custom bridge heads: {STRING2} +STR_CONFIG_SETTING_ENABLE_ROAD_CUSTOM_BRIDGE_HEADS_HELPTEXT :Allow road bridges to have custom, non-straight flat entry/exit tiles + STR_CONFIG_SETTING_QUERY_CAPTION :{WHITE}Change setting value # Config errors diff --git a/src/saveload/afterload.cpp b/src/saveload/afterload.cpp index de3f7ccff9..7c70a2ac53 100644 --- a/src/saveload/afterload.cpp +++ b/src/saveload/afterload.cpp @@ -2968,6 +2968,14 @@ bool AfterLoadGame() #endif } + if (SlXvIsFeatureMissing(XSLFI_CUSTOM_BRIDGE_HEADS)) { + /* ensure that previously unused custom bridge-head bits are cleared */ + for (TileIndex t = 0; t < map_size; t++) { + if (IsBridgeTile(t) && GetTunnelBridgeTransportType(t) == TRANSPORT_ROAD) { + SB(_m[t].m2, 0, 8, 0); + } + } + } /* Station acceptance is some kind of cache */ if (IsSavegameVersionBefore(127)) { diff --git a/src/saveload/extended_ver_sl.cpp b/src/saveload/extended_ver_sl.cpp index 7b083a7f21..f96977dd71 100644 --- a/src/saveload/extended_ver_sl.cpp +++ b/src/saveload/extended_ver_sl.cpp @@ -45,6 +45,7 @@ std::vector _sl_xv_discardable_chunk_ids; ///< list of chunks static const uint32 _sl_xv_slxi_chunk_version = 0; ///< current version os SLXI chunk const SlxiSubChunkInfo _sl_xv_sub_chunk_infos[] = { + { XSLFI_CUSTOM_BRIDGE_HEADS, XSCF_NULL, 1, 1, "custom_bridge_heads", NULL, NULL, NULL }, { XSLFI_NULL, XSCF_NULL, 0, 0, NULL, NULL, NULL, NULL },// This is the end marker }; diff --git a/src/saveload/extended_ver_sl.h b/src/saveload/extended_ver_sl.h index b495c60c4e..896e0509b6 100644 --- a/src/saveload/extended_ver_sl.h +++ b/src/saveload/extended_ver_sl.h @@ -21,6 +21,7 @@ */ enum SlXvFeatureIndex { XSLFI_NULL = 0, ///< Unused value, to indicate that no extended feature test is in use + XSLFI_CUSTOM_BRIDGE_HEADS, ///< Custom bridge heads XSLFI_SIZE, ///< Total count of features, including null feature }; diff --git a/src/settings_gui.cpp b/src/settings_gui.cpp index 0652d1bd81..0fcab66738 100644 --- a/src/settings_gui.cpp +++ b/src/settings_gui.cpp @@ -1649,6 +1649,7 @@ static SettingsContainer &GetSettingsTree() limitations->Add(new SettingEntry("construction.road_stop_on_town_road")); limitations->Add(new SettingEntry("construction.road_stop_on_competitor_road")); limitations->Add(new SettingEntry("vehicle.disable_elrails")); + limitations->Add(new SettingEntry("construction.road_custom_bridge_heads")); } SettingsPage *disasters = main->Add(new SettingsPage(STR_CONFIG_SETTING_ACCIDENTS)); diff --git a/src/settings_type.h b/src/settings_type.h index 41366a7719..f968c0034e 100644 --- a/src/settings_type.h +++ b/src/settings_type.h @@ -311,6 +311,7 @@ struct ConstructionSettings { bool freeform_edges; ///< allow terraforming the tiles at the map edges uint8 extra_tree_placement; ///< (dis)allow building extra trees in-game uint8 command_pause_level; ///< level/amount of commands that can't be executed while paused + uint8 road_custom_bridge_heads; ///< allow construction of road custom bridge heads 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.ini b/src/table/settings.ini index 3a951f9b62..77842003b7 100644 --- a/src/table/settings.ini +++ b/src/table/settings.ini @@ -1229,6 +1229,15 @@ str = STR_CONFIG_SETTING_STOP_ON_COMPETITOR_ROAD strhelp = STR_CONFIG_SETTING_STOP_ON_COMPETITOR_ROAD_HELPTEXT cat = SC_BASIC +[SDT_BOOL] +base = GameSettings +var = construction.road_custom_bridge_heads +def = true +cat = SC_BASIC +str = STR_CONFIG_SETTING_ENABLE_ROAD_CUSTOM_BRIDGE_HEADS +strhelp = STR_CONFIG_SETTING_ENABLE_ROAD_CUSTOM_BRIDGE_HEADS_HELPTEXT +patxname = ""custom_bridge_heads.construction.road_custom_bridge_heads"" + [SDT_BOOL] base = GameSettings var = station.adjacent_stations