diff --git a/distribution/changelog.txt b/distribution/changelog.txt index c0ffacf556..c2653a3a21 100644 --- a/distribution/changelog.txt +++ b/distribution/changelog.txt @@ -7,6 +7,7 @@ - Fix: [#22921] Wooden RollerCoaster flat to steep railings appear in front of track in front of them. - Fix: [#22962] Fuzzy horizontal-to-vertical line transitions in charts. - Fix: [#23009] Scenarios from RCT Classic (.sea files) are not included in the scenario index. +- Fix: [#23015] Crash when loading a save game when the construction window is still open. 0.4.15 (2024-10-06) ------------------------------------------------------------------------ diff --git a/src/openrct2-ui/windows/LoadSave.cpp b/src/openrct2-ui/windows/LoadSave.cpp index 58b7ec134c..c15424d652 100644 --- a/src/openrct2-ui/windows/LoadSave.cpp +++ b/src/openrct2-ui/windows/LoadSave.cpp @@ -267,6 +267,11 @@ namespace OpenRCT2::Ui::Windows char pathBuffer[MAX_PATH]; SafeStrCpy(pathBuffer, path, sizeof(pathBuffer)); + // Closing this will cause a Ride window to pop up, so we have to do this to ensure that + // no windows are open (besides the toolbars and LoadSave window). + WindowCloseByClass(WindowClass::RideConstruction); + WindowCloseAllExceptClass(WindowClass::Loadsave); + auto& gameState = GetGameState(); switch (_type & 0x0F)