diff --git a/src/openrct2/paint/tile_element/Paint.Path.cpp b/src/openrct2/paint/tile_element/Paint.Path.cpp index b6eeb0b752..c70c206843 100644 --- a/src/openrct2/paint/tile_element/Paint.Path.cpp +++ b/src/openrct2/paint/tile_element/Paint.Path.cpp @@ -836,7 +836,7 @@ void path_paint(paint_session* session, uint16_t height, const TileElement* tile } // For debugging purpose, show blocked tiles with a colour - if (gPaintBlockedTiles && (tile_element->flags & TILE_ELEMENT_FLAG_BLOCKED_BY_VEHICLE)) + if (gPaintBlockedTiles && tile_element->AsPath()->IsBlockedByVehicle()) { imageFlags = COLOUR_BRIGHT_GREEN << 19 | COLOUR_GREY << 24 | IMAGE_TYPE_REMAP; } diff --git a/src/openrct2/ride/Ride.cpp b/src/openrct2/ride/Ride.cpp index a9b22316d3..16c5b1b1bc 100644 --- a/src/openrct2/ride/Ride.cpp +++ b/src/openrct2/ride/Ride.cpp @@ -1246,7 +1246,7 @@ void ride_clear_blocked_tiles(Ride* ride) auto footpathElement = map_get_footpath_element(x, y, element->base_height); if (footpathElement != nullptr) { - footpathElement->flags &= ~TILE_ELEMENT_FLAG_BLOCKED_BY_VEHICLE; + footpathElement->AsPath()->SetIsBlockedByVehicle(false); } } } while (!(element++)->IsLastForTile()); diff --git a/src/openrct2/ride/Vehicle.cpp b/src/openrct2/ride/Vehicle.cpp index 31f5f78468..db026cd1c9 100644 --- a/src/openrct2/ride/Vehicle.cpp +++ b/src/openrct2/ride/Vehicle.cpp @@ -9925,12 +9925,12 @@ void vehicle_update_crossings(const rct_vehicle* vehicle) if (tileElement) { - if (!playedClaxon && 0 == (tileElement->flags & TILE_ELEMENT_FLAG_BLOCKED_BY_VEHICLE)) + if (!playedClaxon && !tileElement->AsPath()->IsBlockedByVehicle()) { vehicle_claxon(vehicle); } crossingBonus = 4; - tileElement->flags |= TILE_ELEMENT_FLAG_BLOCKED_BY_VEHICLE; + tileElement->AsPath()->SetIsBlockedByVehicle(true); } else { @@ -9997,7 +9997,7 @@ void vehicle_update_crossings(const rct_vehicle* vehicle) xyElement.x / 32, xyElement.y / 32, xyElement.element->base_height); if (tileElement) { - tileElement->flags &= ~TILE_ELEMENT_FLAG_BLOCKED_BY_VEHICLE; + tileElement->AsPath()->SetIsBlockedByVehicle(false); } } } diff --git a/src/openrct2/world/Footpath.cpp b/src/openrct2/world/Footpath.cpp index 7c4f5786a3..22645fd469 100644 --- a/src/openrct2/world/Footpath.cpp +++ b/src/openrct2/world/Footpath.cpp @@ -2433,8 +2433,8 @@ void footpath_update_path_wide_flags(int32_t x, int32_t y) bool footpath_is_blocked_by_vehicle(const TileCoordsXYZ& position) { - auto pathElement = map_get_path_element_at(position.x, position.y, position.z); - return pathElement != nullptr && (pathElement->flags & TILE_ELEMENT_FLAG_BLOCKED_BY_VEHICLE); + auto pathElement = map_get_path_element_at(position.x, position.y, position.z)->AsPath(); + return pathElement != nullptr && pathElement->IsBlockedByVehicle(); } /** diff --git a/src/openrct2/world/LargeScenery.cpp b/src/openrct2/world/LargeScenery.cpp index ce9b671a88..cc3114c5f2 100644 --- a/src/openrct2/world/LargeScenery.cpp +++ b/src/openrct2/world/LargeScenery.cpp @@ -52,7 +52,7 @@ void LargeSceneryElement::SetBannerIndex(BannerIndex newIndex) bool LargeSceneryElement::IsAccounted() const { - return flags & TILE_ELEMENT_FLAG_LARGE_SCENERY_ACCOUNTED; + return (flags & TILE_ELEMENT_FLAG_LARGE_SCENERY_ACCOUNTED) != 0; } void LargeSceneryElement::SetIsAccounted(bool isAccounted)