(svn r11649) -Codechange: some code can be simplified thanks to changes in r11642
This commit is contained in:
@@ -133,15 +133,8 @@ CommandCost CmdRemoveRoad(TileIndex tile, uint32 flags, uint32 p1, uint32 p2)
|
||||
|
||||
case MP_TUNNELBRIDGE:
|
||||
{
|
||||
TileIndex endtile;
|
||||
if (IsTunnel(tile)) {
|
||||
if (GetTunnelBridgeTransportType(tile) != TRANSPORT_ROAD) return CMD_ERROR;
|
||||
endtile = GetOtherTunnelEnd(tile);
|
||||
} else {
|
||||
if (GetTunnelBridgeTransportType(tile) != TRANSPORT_ROAD) return CMD_ERROR;
|
||||
endtile = GetOtherBridgeEnd(tile);
|
||||
}
|
||||
|
||||
if (GetTunnelBridgeTransportType(tile) != TRANSPORT_ROAD) return CMD_ERROR;
|
||||
TileIndex endtile = IsTunnel(tile) ? GetOtherTunnelEnd(tile) : GetOtherBridgeEnd(tile);
|
||||
if (GetVehicleTunnelBridge(tile, endtile) != NULL) return CMD_ERROR;
|
||||
} break;
|
||||
|
||||
@@ -514,15 +507,11 @@ CommandCost CmdBuildRoad(TileIndex tile, uint32 flags, uint32 p1, uint32 p2)
|
||||
|
||||
case MP_TUNNELBRIDGE:
|
||||
{
|
||||
TileIndex endtile;
|
||||
if (IsTunnel(tile)) {
|
||||
if (GetTunnelBridgeTransportType(tile) != TRANSPORT_ROAD) return CMD_ERROR;
|
||||
endtile = GetOtherTunnelEnd(tile);
|
||||
} else {
|
||||
if (GetTunnelBridgeTransportType(tile) != TRANSPORT_ROAD) return CMD_ERROR;
|
||||
endtile = GetOtherBridgeEnd(tile);
|
||||
}
|
||||
if (GetTunnelBridgeTransportType(tile) != TRANSPORT_ROAD) return CMD_ERROR;
|
||||
if (HasBit(GetRoadTypes(tile), rt)) return_cmd_error(STR_1007_ALREADY_BUILT);
|
||||
|
||||
TileIndex endtile = IsTunnel(tile) ? GetOtherTunnelEnd(tile) : GetOtherBridgeEnd(tile);
|
||||
|
||||
/* Don't allow "upgrading" the bridge/tunnel when vehicles are already driving on it */
|
||||
if (GetVehicleTunnelBridge(tile, endtile) != NULL) return CMD_ERROR;
|
||||
} break;
|
||||
|
Reference in New Issue
Block a user