1
0
mirror of https://github.com/OpenRCT2/OpenRCT2 synced 2026-01-29 17:54:50 +01:00

Close #18632: Display land ownership on the water (#21150)

Co-authored-by: pfroud <pfroud@users.noreply.github.com>
This commit is contained in:
Michael Steenbeek
2024-01-12 08:14:11 +01:00
committed by GitHub
parent 3023784bbf
commit 0e5c82e2d4
5 changed files with 123 additions and 48 deletions

View File

@@ -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;