1
0
mirror of https://github.com/OpenTTD/OpenTTD synced 2026-01-22 11:44:17 +01:00

Fix #14982: Can't place buoys under bridges. (#15007)

Bridges can be built over buoys but not the other way around.
This commit is contained in:
Peter Nelson
2026-01-01 16:31:08 +00:00
committed by GitHub
parent f57c2cc56e
commit 27c5f9a5cd
2 changed files with 16 additions and 1 deletions

View File

@@ -960,6 +960,20 @@ static CommandCost IsDockBridgeAboveOk(TileIndex tile, StationGfx layout)
return IsStationBridgeAboveOk(tile, bridgeable_info, StationType::Dock, layout, GetBridgeHeight(rampsouth), STR_ERROR_MUST_DEMOLISH_BRIDGE_FIRST);
}
/**
* Test if a buoy can be built below a bridge.
* @param tile Tile to test.
* @return Command result.
*/
CommandCost IsBuoyBridgeAboveOk(TileIndex tile)
{
if (!IsBridgeAbove(tile)) return CommandCost();
TileIndex rampsouth = GetSouthernBridgeEnd(tile);
auto bridgeable_info = GetStationBridgeableTileInfo(StationType::Buoy);
return IsStationBridgeAboveOk(tile, bridgeable_info, StationType::Buoy, 0, GetBridgeHeight(rampsouth), STR_ERROR_MUST_DEMOLISH_BRIDGE_FIRST);
}
/**
* Checks if a rail station can be built at the given tile.
* @param tile_cur Tile to check.