1
0
mirror of https://github.com/OpenTTD/OpenTTD synced 2026-01-18 18:02:37 +01:00

Fix 0b99a0b: Incorrect error message for aqueducts reaching northern map borders (#14974)

This commit is contained in:
Cyprian Klimaszewski
2026-01-08 23:14:58 +01:00
committed by GitHub
parent bee3bc0ce5
commit fadeeb6da1

View File

@@ -313,7 +313,12 @@ CommandCost CmdBuildBridge(DoCommandFlags flags, TileIndex tile_end, TileIndex t
RailType railtype = INVALID_RAILTYPE;
RoadType roadtype = INVALID_ROADTYPE;
if (!IsValidTile(tile_start)) return CommandCost(STR_ERROR_BRIDGE_THROUGH_MAP_BORDER);
for (TileIndex t : {tile_start, tile_end}) {
if (!IsValidTile(t)) return CommandCost(STR_ERROR_BRIDGE_THROUGH_MAP_BORDER);
/* User cannot modify height of tiles with one coordinate equal to zero, they are always at the sea level, and you can't build bridge in the sea.
* Furthermore, they are void tiles unless map is infinite water. If we don't return for them here, we will still fail as their slope is invalid. */
if (TileX(t) == 0 || TileY(t) == 0) return CommandCost(transport_type == TRANSPORT_WATER ? STR_ERROR_BRIDGE_THROUGH_MAP_BORDER : STR_ERROR_TOO_CLOSE_TO_EDGE_OF_MAP);
}
/* type of bridge */
switch (transport_type) {