mirror of https://github.com/OpenRCT2/OpenRCT2.git
Merge pull request #8070 from Gymnasiast/fix/8057
Fix three tile element crashes
This commit is contained in:
commit
12145a34ee
|
@ -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)
|
if (interactionType != VIEWPORT_INTERACTION_ITEM_RIDE)
|
||||||
return;
|
return;
|
||||||
|
if (tileElement->GetType() != TILE_ELEMENT_TYPE_TRACK)
|
||||||
|
return;
|
||||||
if (tileElement->AsTrack()->GetRideIndex() != w->number)
|
if (tileElement->AsTrack()->GetRideIndex() != w->number)
|
||||||
return;
|
return;
|
||||||
if (tileElement->AsTrack()->GetColourScheme() == newColourScheme)
|
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
|
// 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;
|
return;
|
||||||
|
|
||||||
for (int32_t xOffset = -1; xOffset <= 1; xOffset++)
|
for (int32_t xOffset = -1; xOffset <= 1; xOffset++)
|
||||||
|
|
|
@ -3664,10 +3664,10 @@ void map_update_tiles()
|
||||||
interleaved_xy >>= 1;
|
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)
|
if (tileElement != nullptr)
|
||||||
{
|
{
|
||||||
tileElement->UpdateGrassLength({ x * 32, y * 32 });
|
tileElement->AsSurface()->UpdateGrassLength({ x * 32, y * 32 });
|
||||||
scenery_update_tile(x * 32, y * 32);
|
scenery_update_tile(x * 32, y * 32);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue