Use IsBlockedByVehicle

This commit is contained in:
duncanspumpkin committed 2019-02-27 10:49:48 +00:00
1 parent 354cce71eb
commit 6495ffdb34
5 files changed
+8 -8

No files matched your search

@@ -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;
}
+1 -1
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());
+3 -3
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);
}
}
}
+2 -2
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();
}
/**
+1 -1
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)