From 90f04cf4781035f77c9ad43f50da2eeda2f95a11 Mon Sep 17 00:00:00 2001 From: Gymnasiast Date: Tue, 9 Oct 2018 22:12:29 +0200 Subject: [PATCH 1/3] Fix #8057: Game crashes when placing an entrance --- src/openrct2/world/Footpath.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/openrct2/world/Footpath.cpp b/src/openrct2/world/Footpath.cpp index f7f6fab3eb..ed47ac4563 100644 --- a/src/openrct2/world/Footpath.cpp +++ b/src/openrct2/world/Footpath.cpp @@ -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++) From 59a0c6e4878e468dbec0a3007add313a489b7bf7 Mon Sep 17 00:00:00 2001 From: Gymnasiast Date: Tue, 9 Oct 2018 22:15:12 +0200 Subject: [PATCH 2/3] Fix #8047: Crash when using the paint tool and you click an entrance/exit --- src/openrct2-ui/windows/Ride.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/openrct2-ui/windows/Ride.cpp b/src/openrct2-ui/windows/Ride.cpp index fddef51490..5e12aa3a65 100644 --- a/src/openrct2-ui/windows/Ride.cpp +++ b/src/openrct2-ui/windows/Ride.cpp @@ -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) From 461342a91561e39fb2be2142c5dd9ac836b71e38 Mon Sep 17 00:00:00 2001 From: Gymnasiast Date: Tue, 9 Oct 2018 22:20:18 +0200 Subject: [PATCH 3/3] Fix #8048: Crash when opening Six Flags Carolina --- src/openrct2/world/Map.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/openrct2/world/Map.cpp b/src/openrct2/world/Map.cpp index 90262adea1..aaf0b1c7d1 100644 --- a/src/openrct2/world/Map.cpp +++ b/src/openrct2/world/Map.cpp @@ -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); }