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

Function GetBridgeHeight

src/bridge_map.cpp:70–77  ·  view source on GitHub ↗

* Get the height ('z') of a bridge. * @param t the bridge ramp tile to get the bridge height from * @return the height of the bridge. */

Source from the content-addressed store, hash-verified

68 * @return the height of the bridge.
69 */
70int GetBridgeHeight(TileIndex t)
71{
72 auto [tileh, h] = GetTileSlopeZ(t);
73 Foundation f = GetBridgeFoundation(tileh, DiagDirToAxis(GetTunnelBridgeDirection(t)));
74
75 /* one height level extra for the ramp */
76 return h + 1 + ApplyFoundationToSlope(f, tileh);
77}

Callers 15

DoBuildLockFunction · 0.85
MarkBridgeDirtyFunction · 0.85
CmdBuildBridgeFunction · 0.85
DoClearBridgeFunction · 0.85
GetTerrainTypeFunction · 0.85
CmdTerraformLandFunction · 0.85
CmdBuildObjectFunction · 0.85
DrawRailCatenaryRailwayFunction · 0.85
IsDockBridgeAboveOkFunction · 0.85

Calls 5

GetTileSlopeZFunction · 0.85
GetBridgeFoundationFunction · 0.85
DiagDirToAxisFunction · 0.85
GetTunnelBridgeDirectionFunction · 0.85
ApplyFoundationToSlopeFunction · 0.85

Tested by

no test coverage detected