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

Function IsDockBridgeAboveOk

src/station_cmd.cpp:954–961  ·  view source on GitHub ↗

* Test if a dock can be built below a bridge. * @param tile Tile to test. * @param layout Layout piece of station to test. * @return Command result. */

Source from the content-addressed store, hash-verified

952 * @return Command result.
953 */
954static CommandCost IsDockBridgeAboveOk(TileIndex tile, StationGfx layout)
955{
956 if (!IsBridgeAbove(tile)) return CommandCost();
957
958 TileIndex rampsouth = GetSouthernBridgeEnd(tile);
959 auto bridgeable_info = GetStationBridgeableTileInfo(StationType::Dock);
960 return IsStationBridgeAboveOk(tile, bridgeable_info, StationType::Dock, layout, GetBridgeHeight(rampsouth), STR_ERROR_MUST_DEMOLISH_BRIDGE_FIRST);
961}
962
963/**
964 * Test if a buoy can be built below a bridge.

Callers 1

CmdBuildDockFunction · 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