diff --git a/src/lang/english.txt b/src/lang/english.txt index 0b3352e4cc..5327476bde 100644 --- a/src/lang/english.txt +++ b/src/lang/english.txt @@ -5006,6 +5006,7 @@ STR_ERROR_TUNNEL_THROUGH_MAP_BORDER :{WHITE}Tunnel w STR_ERROR_UNABLE_TO_EXCAVATE_LAND :{WHITE}Unable to excavate land for other end of tunnel STR_ERROR_TUNNEL_TOO_LONG :{WHITE}... tunnel too long STR_ERROR_TUNNEL_RAMP_TOO_SHORT :{WHITE}... ramp too short, tunnels under water must have a ramp at least three tiles long at both ends. +STR_ERROR_TUNNEL_TOO_MANY :{WHITE}... too many tunnels STR_ERROR_NO_DRILLING_ABOVE_CHUNNEL :{WHITE}No oil rigs allowed above underwater tunnels. STR_ERROR_ANOTHER_TUNNEL_IN_THE_WAY_FOR_CHUNNEL :{WHITE}Three tiles are needed to pass under the other tunnel. diff --git a/src/saveload/afterload.cpp b/src/saveload/afterload.cpp index 1791870e0a..5066c55598 100644 --- a/src/saveload/afterload.cpp +++ b/src/saveload/afterload.cpp @@ -2038,7 +2038,12 @@ bool AfterLoadGame() TileIndex start_tile = t; TileIndex end_tile = GetOtherTunnelBridgeEndOld(start_tile); - if (!Tunnel::CanAllocateItem()) return false; + if (!Tunnel::CanAllocateItem()) { + SetSaveLoadError(STR_ERROR_TUNNEL_TOO_MANY); + /* Restore the signals */ + ResetSignalHandlers(); + return false; + } const Tunnel *t = new Tunnel(start_tile, end_tile, false); diff --git a/src/tunnelbridge_cmd.cpp b/src/tunnelbridge_cmd.cpp index a57ce8c1f9..22a862c6e1 100644 --- a/src/tunnelbridge_cmd.cpp +++ b/src/tunnelbridge_cmd.cpp @@ -813,7 +813,7 @@ CommandCost CmdBuildTunnel(TileIndex start_tile, DoCommandFlag flags, uint32 p1, TileIndex ts = end_tile; if(start_tile > end_tile) Swap(tn, ts); - if (!Tunnel::CanAllocateItem()) return CMD_ERROR; + if (!Tunnel::CanAllocateItem()) return_cmd_error(STR_ERROR_TUNNEL_TOO_MANY); const Tunnel *t = new Tunnel(tn, ts, is_chunnel); if (transport_type == TRANSPORT_RAIL) {