MCPcopy Create free account
hub / github.com/OpenTTD/OpenTTD / IsBuoyBridgeAboveOk

Function IsBuoyBridgeAboveOk

src/station_cmd.cpp:968–975  ·  view source on GitHub ↗

* Test if a buoy can be built below a bridge. * @param tile Tile to test. * @return Command result. */

Source from the content-addressed store, hash-verified

966 * @return Command result.
967 */
968CommandCost IsBuoyBridgeAboveOk(TileIndex tile)
969{
970 if (!IsBridgeAbove(tile)) return CommandCost();
971
972 TileIndex rampsouth = GetSouthernBridgeEnd(tile);
973 auto bridgeable_info = GetStationBridgeableTileInfo(StationType::Buoy);
974 return IsStationBridgeAboveOk(tile, bridgeable_info, StationType::Buoy, 0, GetBridgeHeight(rampsouth), STR_ERROR_MUST_DEMOLISH_BRIDGE_FIRST);
975}
976
977/**
978 * Checks if a rail station can be built at the given tile.

Callers 1

CmdBuildBuoyFunction · 0.85

Calls 6

IsBridgeAboveFunction · 0.85
CommandCostClass · 0.85
GetSouthernBridgeEndFunction · 0.85
IsStationBridgeAboveOkFunction · 0.85
GetBridgeHeightFunction · 0.85

Tested by

no test coverage detected