1
0
mirror of https://github.com/OpenRCT2/OpenRCT2 synced 2026-01-04 13:42:55 +01:00

Fix #18970: Trying to load a non-park save will now display context error (#19007)

Fix https://github.com/OpenRCT2/OpenRCT2/issues/18970
This commit is contained in:
Henry Cheng
2023-01-06 06:05:04 -05:00
committed by GitHub
parent 2e9d06fabe
commit bf986e43c6
2 changed files with 13 additions and 3 deletions

View File

@@ -7,6 +7,7 @@
- Improved: [#18749] Ability to have 4 active awards for more than one month in a row.
- Improved: [#18826] [Plugin] Added all actions and their documentation to plugin API.
- Improved: [#18945] Languages can now fall back to other languages than English.
- Improved: [#18970] Trying to load a non-park save will now display a context error.
- Fix: [#18467] “Selected only” Object Selection filter is active in Track Designs Manager, and cannot be toggled.
- Fix: [#18905] Ride Construction window theme is not applied correctly.
- Fix: [#18911] Mini Golf station does not draw correctly from all angles.

View File

@@ -269,9 +269,18 @@ static void Select(const char* path)
{
case (LOADSAVETYPE_LOAD | LOADSAVETYPE_GAME):
SetAndSaveConfigPath(gConfigGeneral.LastSaveGameDirectory, pathBuffer);
InvokeCallback(MODAL_RESULT_OK, pathBuffer);
window_close_by_class(WindowClass::Loadsave);
gfx_invalidate_screen();
if (OpenRCT2::GetContext()->LoadParkFromFile(pathBuffer))
{
InvokeCallback(MODAL_RESULT_OK, pathBuffer);
window_close_by_class(WindowClass::Loadsave);
gfx_invalidate_screen();
}
else
{
// Not the best message...
ContextShowError(STR_LOAD_GAME, STR_FAILED_TO_LOAD_FILE_CONTAINS_INVALID_DATA, {});
InvokeCallback(MODAL_RESULT_FAIL, pathBuffer);
}
break;
case (LOADSAVETYPE_SAVE | LOADSAVETYPE_GAME):