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

Use SetIsBroken

This commit is contained in:
duncanspumpkin
2019-02-26 09:24:08 +00:00
parent 6495ffdb34
commit 7840f6a7f7
4 changed files with 16 additions and 15 deletions

View File

@@ -105,7 +105,7 @@ static void cheat_fix_vandalism()
if (!(it.element)->AsPath()->HasAddition())
continue;
it.element->flags &= ~TILE_ELEMENT_FLAG_BROKEN;
it.element->AsPath()->SetIsBroken(false);
} while (tile_element_iterator_next(&it));
gfx_invalidate_screen();

View File

@@ -6185,7 +6185,7 @@ static void peep_update_walking_break_scenery(rct_peep* peep)
return;
}
tileElement->flags |= TILE_ELEMENT_FLAG_BROKEN;
tileElement->AsPath()->SetIsBroken(true);
map_invalidate_tile_zoom1(peep->next_x, peep->next_y, (tileElement->base_height << 3) + 32, tileElement->base_height << 3);

View File

@@ -2080,7 +2080,8 @@ private:
uint8_t entryIndex = _pathTypeToEntryMap[pathType];
dst2->SetDirection(0);
dst2->flags &= ~(TILE_ELEMENT_FLAG_BROKEN | TILE_ELEMENT_FLAG_INDESTRUCTIBLE_TRACK_PIECE);
dst2->SetIsBroken(false);
dst2->SetIsBlockedByVehicle(false);
dst2->SetPathEntryIndex(entryIndex);
dst2->SetShouldDrawPathOverSupports(true);
@@ -2121,7 +2122,7 @@ private:
entryIndex = _pathAdditionTypeToEntryMap[normalisedType];
if (additionType != normalisedType)
{
dst2->flags |= TILE_ELEMENT_FLAG_BROKEN;
dst2->SetIsBroken(true);
}
dst2->SetAddition(entryIndex + 1);
}

View File

@@ -287,9 +287,9 @@ static money32 footpath_element_insert(
if (type & FOOTPATH_ELEMENT_INSERT_QUEUE)
pathElement->SetIsQueue(true);
pathElement->SetAddition(pathItemType);
tileElement->AsPath()->SetRideIndex(RIDE_ID_NULL);
tileElement->AsPath()->SetAdditionStatus(255);
pathElement->flags &= ~TILE_ELEMENT_FLAG_BROKEN;
pathElement->SetRideIndex(RIDE_ID_NULL);
pathElement->SetAdditionStatus(255);
pathElement->SetIsBroken(false);
if (flags & GAME_COMMAND_FLAG_GHOST)
pathElement->SetGhost(true);
@@ -394,7 +394,7 @@ static money32 footpath_element_update(
}
tileElement->AsPath()->SetAddition(pathItemType);
tileElement->flags &= ~TILE_ELEMENT_FLAG_BROKEN;
tileElement->AsPath()->SetIsBroken(false);
if (pathItemType != 0)
{
rct_scenery_entry* scenery_entry = get_footpath_item_entry(pathItemType - 1);
@@ -423,7 +423,7 @@ static money32 footpath_element_update(
else
tileElement->AsPath()->SetIsQueue(false);
tileElement->AsPath()->SetAddition(pathItemType);
tileElement->flags &= ~TILE_ELEMENT_FLAG_BROKEN;
tileElement->AsPath()->SetIsBroken(false);
loc_6A6620(flags, x, y, tileElement);
}
@@ -678,13 +678,13 @@ static money32 footpath_place_from_track(
if (slope & FOOTPATH_PROPERTIES_FLAG_IS_SLOPED)
pathElement->SetSloped(true);
if (type & (1 << 7))
tileElement->AsPath()->SetIsQueue(true);
pathElement->SetIsQueue(true);
pathElement->SetAddition(0);
tileElement->AsPath()->SetRideIndex(RIDE_ID_NULL);
tileElement->AsPath()->SetAdditionStatus(255);
tileElement->AsPath()->SetEdges(edges);
tileElement->AsPath()->SetCorners(0);
pathElement->flags &= ~TILE_ELEMENT_FLAG_BROKEN;
pathElement->SetRideIndex(RIDE_ID_NULL);
pathElement->SetAdditionStatus(255);
pathElement->SetEdges(edges);
pathElement->SetCorners(0);
pathElement->SetIsBroken(false);
if (flags & (1 << 6))
pathElement->SetGhost(true);