mirror of
https://github.com/OpenRCT2/OpenRCT2
synced 2026-01-29 17:54:50 +01:00
Co-authored-by: pfroud <pfroud@users.noreply.github.com>
This commit is contained in:
committed by
GitHub
parent
3023784bbf
commit
0e5c82e2d4
@@ -536,9 +536,20 @@ int16_t TileElementHeight(const CoordsXY& loc)
|
||||
return MINIMUM_LAND_HEIGHT_BIG;
|
||||
}
|
||||
|
||||
uint16_t height = surfaceElement->GetBaseZ();
|
||||
auto height = surfaceElement->GetBaseZ();
|
||||
auto slope = surfaceElement->GetSlope();
|
||||
|
||||
return TileElementHeight(CoordsXYZ{ loc, height }, slope);
|
||||
}
|
||||
|
||||
int16_t TileElementHeight(const CoordsXYZ& loc, uint8_t slope)
|
||||
{
|
||||
// Off the map
|
||||
if (!MapIsLocationValid(loc))
|
||||
return MINIMUM_LAND_HEIGHT_BIG;
|
||||
|
||||
auto height = loc.z;
|
||||
|
||||
uint32_t slope = surfaceElement->GetSlope();
|
||||
uint8_t extra_height = (slope & TILE_ELEMENT_SLOPE_DOUBLE_HEIGHT) >> 4; // 0x10 is the 5th bit - sets slope to double height
|
||||
// Remove the extra height bit
|
||||
slope &= TILE_ELEMENT_SLOPE_ALL_CORNERS_UP;
|
||||
|
||||
Reference in New Issue
Block a user