1
0
mirror of https://github.com/OpenRCT2/OpenRCT2 synced 2026-01-21 22:13:07 +01:00

Replace more direct accesses to base/clearance Z with getter/setter (#10454)

This commit is contained in:
Michael Steenbeek
2019-12-27 15:26:40 +01:00
committed by GitHub
parent 26cce7e82b
commit 8ca0cf52a7
27 changed files with 85 additions and 64 deletions

View File

@@ -706,7 +706,7 @@ bool map_is_location_owned(const CoordsXYZ& loc)
if (surfaceElement->GetOwnership() & OWNERSHIP_CONSTRUCTION_RIGHTS_OWNED)
{
if (loc.z / 8 < surfaceElement->base_height || loc.z / 8 - 2 > surfaceElement->base_height)
if (loc.z < surfaceElement->GetBaseZ() || loc.z - (2 * 8) > surfaceElement->GetBaseZ())
return true;
}
}
@@ -2212,7 +2212,7 @@ TrackElement* map_get_track_element_at_of_type(CoordsXYZD location, int32_t trac
auto trackElement = tileElement->AsTrack();
if (trackElement != nullptr)
{
if (trackElement->base_height != location.z / 8)
if (trackElement->GetBaseZ() != location.z)
continue;
if (trackElement->GetDirection() != location.direction)
continue;
@@ -2235,7 +2235,7 @@ TrackElement* map_get_track_element_at_of_type_seq(CoordsXYZD location, int32_t
auto trackElement = tileElement->AsTrack();
if (trackElement != nullptr)
{
if (trackElement->base_height != location.z / 8)
if (trackElement->GetBaseZ() != location.z)
continue;
if (trackElement->GetDirection() != location.direction)
continue;