From d3cfa07a2af20e1fb85993f0ae849f62f3a600e3 Mon Sep 17 00:00:00 2001 From: Gymnasiast Date: Fri, 1 Oct 2021 13:50:04 +0200 Subject: [PATCH] Fix #15496: crash in paint_swinging_inverter_ship_structure() --- distribution/changelog.txt | 1 + src/openrct2/ride/thrill/SwingingInverterShip.cpp | 3 +++ 2 files changed, 4 insertions(+) diff --git a/distribution/changelog.txt b/distribution/changelog.txt index 14ded1411b..5b1ac91904 100644 --- a/distribution/changelog.txt +++ b/distribution/changelog.txt @@ -28,6 +28,7 @@ - Fix: [#15257] Chat icon shows in scenario/track editor. Other icons don't disable when deactivated in options menu. - Fix: [#15289] Unexpected behavior with duplicated banners which also caused desyncs in multiplayer. - Fix: [#15487] Map animations do not work correctly when loading an exported SV6 file in vanilla RCT2. +- Fix: [#15496] Crash in paint_swinging_inverter_ship_structure(). - Improved: [#3417] Crash dumps are now placed in their own folder. - Change: [#8601] Revert ToonTower base block fix to re-enable support blocking. - Change: [#15174] [Plugin] Deprecate the type "peep" and add support to target a specific scripting api version. diff --git a/src/openrct2/ride/thrill/SwingingInverterShip.cpp b/src/openrct2/ride/thrill/SwingingInverterShip.cpp index 31eccf4b27..eac661e59e 100644 --- a/src/openrct2/ride/thrill/SwingingInverterShip.cpp +++ b/src/openrct2/ride/thrill/SwingingInverterShip.cpp @@ -54,6 +54,9 @@ static void paint_swinging_inverter_ship_structure( const TileElement* savedTileElement = static_cast(session->CurrentlyDrawnItem); rct_ride_entry* rideEntry = get_ride_entry(ride.subtype); + if (rideEntry == nullptr) + return; + Vehicle* vehicle = nullptr; int8_t xOffset = !(direction & 1) ? axisOffset : 0;