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

Function IsRoadStationBridgeAboveOk

src/station_cmd.cpp:939–946  ·  view source on GitHub ↗

* Test if a road station can be built below a bridge. * @param tile Tile to test. * @param spec Custom roadstop spec to test. * @param type Type of road station. * @param layout Layout piece of station to test. * @return Command result. */

Source from the content-addressed store, hash-verified

937 * @return Command result.
938 */
939CommandCost IsRoadStationBridgeAboveOk(TileIndex tile, const RoadStopSpec *spec, StationType type, StationGfx layout)
940{
941 if (!IsBridgeAbove(tile)) return CommandCost();
942
943 TileIndex rampsouth = GetSouthernBridgeEnd(tile);
944 auto bridgeable_info = spec == nullptr ? GetStationBridgeableTileInfo(type) : spec->bridgeable_info;
945 return IsStationBridgeAboveOk(tile, bridgeable_info, type, layout, GetBridgeHeight(rampsouth), STR_ERROR_MUST_DEMOLISH_BRIDGE_FIRST);
946}
947
948/**
949 * Test if a dock can be built below a bridge.

Callers 1

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