src/bridge_map.cpp
branchNewGRF_ports
changeset 6743 cabfaa4a0295
parent 6719 4cc327ad39d5
child 6871 5a9dc001e1ad
equal deleted inserted replaced
6742:1337d6c9b97b 6743:cabfaa4a0295
    42 
    42 
    43 uint GetBridgeHeight(TileIndex t)
    43 uint GetBridgeHeight(TileIndex t)
    44 {
    44 {
    45 	uint h;
    45 	uint h;
    46 	Slope tileh = GetTileSlope(t, &h);
    46 	Slope tileh = GetTileSlope(t, &h);
    47 	uint f = GetBridgeFoundation(tileh, DiagDirToAxis(GetBridgeRampDirection(t)));
    47 	Foundation f = GetBridgeFoundation(tileh, DiagDirToAxis(GetBridgeRampDirection(t)));
    48 
    48 
    49 	/* one height level extra if the ramp is on a flat foundation */
    49 	/* one height level extra if the ramp is on a flat foundation */
    50 	return
    50 	return
    51 		h + TILE_HEIGHT +
    51 		h + TILE_HEIGHT +
    52 		(IS_INT_INSIDE(f, 1, 15) ? TILE_HEIGHT : 0) +
    52 		(IsLeveledFoundation(f) ? TILE_HEIGHT : 0) +
    53 		(IsSteepSlope(tileh) ? TILE_HEIGHT : 0);
    53 		(IsSteepSlope(tileh) ? TILE_HEIGHT : 0);
    54 }
    54 }