diff --git a/src/lang/english.txt b/src/lang/english.txt index 5327476bde..31a87d6262 100644 --- a/src/lang/english.txt +++ b/src/lang/english.txt @@ -1267,6 +1267,9 @@ STR_CONFIG_SETTING_INFRASTRUCTURE_MAINTENANCE_HELPTEXT :When enabled, i STR_CONFIG_SETTING_SHIP_COLLISION_AVOIDANCE :Ships avoid collisions: {STRING2} STR_CONFIG_SETTING_SHIP_COLLISION_AVOIDANCE_HELPTEXT :When enabled, ships try to avoid passing through each other. Requires 90° turns to be forbidden. +STR_CONFIG_SETTING_CHUNNEL :Allow construction of tunnels under water: {STRING2} +STR_CONFIG_SETTING_CHUNNEL_HELPTEXT :When enabled, tunnels can be constructed under bodies of water at sea level. This requires the tunnel ends to be least 3 tiles away from the shore. + STR_CONFIG_SETTING_NO_TRAIN_CRASH_OTHER_COMPANY :Trains from different companies may not crash into each other: {STRING2} STR_CONFIG_SETTING_NO_TRAIN_CRASH_OTHER_COMPANY_HELPTEXT :This setting is primarily to prevent untrusted players deliberately causing crashes involving other companies' trains in multi-player rail infrastructure sharing games. diff --git a/src/settings_gui.cpp b/src/settings_gui.cpp index d90a5b6864..c49bc96351 100644 --- a/src/settings_gui.cpp +++ b/src/settings_gui.cpp @@ -1701,6 +1701,7 @@ static SettingsContainer &GetSettingsTree() limitations->Add(new SettingEntry("construction.max_bridge_length")); limitations->Add(new SettingEntry("construction.max_bridge_height")); limitations->Add(new SettingEntry("construction.max_tunnel_length")); + limitations->Add(new SettingEntry("construction.chunnel")); limitations->Add(new SettingEntry("station.never_expire_airports")); limitations->Add(new SettingEntry("vehicle.never_expire_vehicles")); limitations->Add(new SettingEntry("vehicle.max_trains")); diff --git a/src/settings_type.h b/src/settings_type.h index 372ec8a267..967016c96c 100644 --- a/src/settings_type.h +++ b/src/settings_type.h @@ -355,6 +355,7 @@ struct ConstructionSettings { byte simulated_wormhole_signals; ///< simulate signals in tunnel bool enable_build_river; ///< enable building rivers in-game uint8 road_custom_bridge_heads; ///< allow construction of road custom bridge heads + bool chunnel; ///< allow construction of tunnels under water 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 35d84f781d..e37ccdd841 100644 --- a/src/table/settings.ini +++ b/src/table/settings.ini @@ -597,6 +597,16 @@ str = STR_CONFIG_SETTING_MAX_TUNNEL_LENGTH strhelp = STR_CONFIG_SETTING_MAX_TUNNEL_LENGTH_HELPTEXT strval = STR_CONFIG_SETTING_TILE_LENGTH +[SDT_BOOL] +base = GameSettings +var = construction.chunnel +def = false +str = STR_CONFIG_SETTING_CHUNNEL +strhelp = STR_CONFIG_SETTING_CHUNNEL_HELPTEXT +from = 0 +cat = SC_BASIC +patxname = ""chunnel.construction.chunnel"" + [SDT_VAR] base = GameSettings var = construction.simulated_wormhole_signals diff --git a/src/tunnelbridge_cmd.cpp b/src/tunnelbridge_cmd.cpp index 22a862c6e1..0bd2e54bb8 100644 --- a/src/tunnelbridge_cmd.cpp +++ b/src/tunnelbridge_cmd.cpp @@ -692,7 +692,7 @@ CommandCost CmdBuildTunnel(TileIndex start_tile, DoCommandFlag flags, uint32 p1, _build_tunnel_endtile = found_tunnel_tile != INVALID_TILE ? found_tunnel_tile : end_tile; /* Test if we are on a shore. */ - if (end_z == 0 && + if (end_z == 0 && _settings_game.construction.chunnel && (IsCoastTile(end_tile) || (IsValidTile(end_tile + delta) && HasTileWaterGround(end_tile + delta)) || (IsValidTile(end_tile + delta * 2) && HasTileWaterGround(end_tile + delta * 2)))) {