Chunnel: Add error text for too many tunnels.
This commit is contained in:
@@ -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_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_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_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_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.
|
STR_ERROR_ANOTHER_TUNNEL_IN_THE_WAY_FOR_CHUNNEL :{WHITE}Three tiles are needed to pass under the other tunnel.
|
||||||
|
|
||||||
|
@@ -2038,7 +2038,12 @@ bool AfterLoadGame()
|
|||||||
TileIndex start_tile = t;
|
TileIndex start_tile = t;
|
||||||
TileIndex end_tile = GetOtherTunnelBridgeEndOld(start_tile);
|
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);
|
const Tunnel *t = new Tunnel(start_tile, end_tile, false);
|
||||||
|
|
||||||
|
@@ -813,7 +813,7 @@ CommandCost CmdBuildTunnel(TileIndex start_tile, DoCommandFlag flags, uint32 p1,
|
|||||||
TileIndex ts = end_tile;
|
TileIndex ts = end_tile;
|
||||||
if(start_tile > end_tile) Swap(tn, ts);
|
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);
|
const Tunnel *t = new Tunnel(tn, ts, is_chunnel);
|
||||||
|
|
||||||
if (transport_type == TRANSPORT_RAIL) {
|
if (transport_type == TRANSPORT_RAIL) {
|
||||||
|
Reference in New Issue
Block a user