From 41c0395adb14b364d4ba72b18a9a1fb304e8aef7 Mon Sep 17 00:00:00 2001 From: Keith Stellyes Date: Sun, 18 Oct 2020 10:54:26 -0700 Subject: [PATCH] Fix #13226: No error is shown when attempting to load a corrupted save --- distribution/changelog.txt | 1 + src/openrct2/Context.cpp | 6 +++++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/distribution/changelog.txt b/distribution/changelog.txt index d1a5d273b0..70fe5d2d4f 100644 --- a/distribution/changelog.txt +++ b/distribution/changelog.txt @@ -33,6 +33,7 @@ - Fix: [#13129] Missing error message when waiting for train to leave station on the ride measurements graph. - Fix: [#13138] Fix logical sorting of list windows. - Fix: [#13158] Cursors are drawn incorrectly in text input fields. +- Fix: [#13226] No error is shown when attempting to load a corrupted save. - Improved: [#13023] Made add_news_item console command last argument, assoc, optional. - Improved: [#13098] Improvements to the maze construction window user interface - Improved: [#13125] Selecting the RCT2 files now uses localised dialogs. diff --git a/src/openrct2/Context.cpp b/src/openrct2/Context.cpp index ac6759e95e..9ccc4bc150 100644 --- a/src/openrct2/Context.cpp +++ b/src/openrct2/Context.cpp @@ -562,7 +562,11 @@ namespace OpenRCT2 else { auto fs = FileStream(path, FILE_MODE_OPEN); - return LoadParkFromStream(&fs, path, loadTitleScreenOnFail); + if (!LoadParkFromStream(&fs, path, loadTitleScreenOnFail)) + { + throw std::runtime_error("Failed to load park"); + } + return true; } } catch (const std::exception& e)