From 06081eb23d896861f71fc548dd767d7da1e212dc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Janiszewski?= Date: Mon, 1 Apr 2024 00:23:37 +0200 Subject: [PATCH] Fix #21691: Use correct iterator in RideCheckTrackContainsBanked (#21701) --- distribution/changelog.txt | 1 + src/openrct2/ride/Ride.cpp | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/distribution/changelog.txt b/distribution/changelog.txt index 27236e3755..f0ffa63cfa 100644 --- a/distribution/changelog.txt +++ b/distribution/changelog.txt @@ -28,6 +28,7 @@ - Fix: [#21641] Crash when creating track iterator from an invalid tile element. - Fix: [#21652] Dialog window to confirm overwriting files does not apply the theme colours correctly. - Fix: [#21668] Crash when on null ride in Guest::UpdateRideLeaveExit. +- Fix: [#21691] Crash when validating rides which can't contain banked track. - Fix: [objects#290] “Haunted Mansion” cars have a non-functional third remap colour. - Fix: [objects#296] Incorrect wall placement around large Kremlin/drab pieces. - Fix: [objects#300] Incorrect Colosseum and volcano corner clearances. diff --git a/src/openrct2/ride/Ride.cpp b/src/openrct2/ride/Ride.cpp index 26782267d4..d0300a5cf3 100644 --- a/src/openrct2/ride/Ride.cpp +++ b/src/openrct2/ride/Ride.cpp @@ -2858,7 +2858,7 @@ static bool RideCheckTrackContainsBanked(const CoordsXYE& input, CoordsXYE* outp while (TrackCircuitIteratorNext(&it)) { - auto trackType = output->element->AsTrack()->GetTrackType(); + auto trackType = it.current.element->AsTrack()->GetTrackType(); const auto& ted = GetTrackElementDescriptor(trackType); if (ted.Flags & TRACK_ELEM_FLAG_BANKED) {