Chunnel: Add setting to enable construction, default off.

pull/16/head
Jonathan G Rennison 7 years ago
parent 02b33e7f64
commit 212f6ce6ef

@ -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.

@ -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"));

@ -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?

@ -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

@ -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)))) {

Loading…
Cancel
Save