mirror of
https://github.com/OpenRCT2/OpenRCT2
synced 2026-01-25 15:54:31 +01:00
Merge pull request #8070 from Gymnasiast/fix/8057
Fix three tile element crashes
This commit is contained in:
@@ -4273,6 +4273,8 @@ static void window_ride_set_track_colour_scheme(rct_window* w, int32_t x, int32_
|
||||
|
||||
if (interactionType != VIEWPORT_INTERACTION_ITEM_RIDE)
|
||||
return;
|
||||
if (tileElement->GetType() != TILE_ELEMENT_TYPE_TRACK)
|
||||
return;
|
||||
if (tileElement->AsTrack()->GetRideIndex() != w->number)
|
||||
return;
|
||||
if (tileElement->AsTrack()->GetColourScheme() == newColourScheme)
|
||||
|
||||
@@ -2530,7 +2530,7 @@ static void footpath_fix_corners_around(int32_t x, int32_t y, rct_tile_element*
|
||||
};
|
||||
|
||||
// Sloped paths don't create filled corners, so no need to remove any
|
||||
if (pathElement->AsPath()->IsSloped())
|
||||
if (pathElement->GetType() == TILE_ELEMENT_TYPE_PATH && pathElement->AsPath()->IsSloped())
|
||||
return;
|
||||
|
||||
for (int32_t xOffset = -1; xOffset <= 1; xOffset++)
|
||||
|
||||
@@ -3664,10 +3664,10 @@ void map_update_tiles()
|
||||
interleaved_xy >>= 1;
|
||||
}
|
||||
|
||||
SurfaceElement* tileElement = map_get_surface_element_at(x, y)->AsSurface();
|
||||
rct_tile_element* tileElement = map_get_surface_element_at(x, y);
|
||||
if (tileElement != nullptr)
|
||||
{
|
||||
tileElement->UpdateGrassLength({ x * 32, y * 32 });
|
||||
tileElement->AsSurface()->UpdateGrassLength({ x * 32, y * 32 });
|
||||
scenery_update_tile(x * 32, y * 32);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user