Use IsBlockedByVehicle

This commit is contained in:
duncanspumpkin 2019-02-26 09:15:39 +00:00
parent 354cce71eb
commit 6495ffdb34
5 changed files with 8 additions and 8 deletions

View File

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

View File

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

View File

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

View File

@ -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();
}
/**

View File

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