From 8422556bc1d19e8b5e697b72cce3ceccd24a4b56 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20M=C3=BCller?= Date: Thu, 2 Nov 2017 18:39:48 +0100 Subject: [PATCH] Fix #6566 and #6573: Highscores don't get saved For some RCT2 parks the scenario name in the sv6 file is wrong, so take the real filename. --- src/openrct2/rct2/S6Importer.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/openrct2/rct2/S6Importer.cpp b/src/openrct2/rct2/S6Importer.cpp index 7cab441b32..01705d5310 100644 --- a/src/openrct2/rct2/S6Importer.cpp +++ b/src/openrct2/rct2/S6Importer.cpp @@ -181,6 +181,8 @@ public: { return ParkLoadResult::CreateMissingObjects(missingObjects); } + + _s6Path = path; return ParkLoadResult::CreateOK(); } @@ -356,7 +358,8 @@ public: gParkEntrances[i].z = _s6.park_entrance_z[i]; gParkEntrances[i].direction = _s6.park_entrance_direction[i]; } - String::Set(gScenarioFileName, sizeof(gScenarioFileName), _s6.scenario_filename); + // _s6.scenario_filename is wrong for some RCT2 expansion scenarios, so we use the real filename + String::Set(gScenarioFileName, sizeof(gScenarioFileName), Path::GetFileName(_s6Path)); memcpy(gScenarioExpansionPacks, _s6.saved_expansion_pack_names, sizeof(_s6.saved_expansion_pack_names)); memcpy(gBanners, _s6.banners, sizeof(_s6.banners)); memcpy(gUserStrings, _s6.custom_strings, sizeof(_s6.custom_strings));