From a428f20d46e553bbfaa0fc332aa2590f1e966695 Mon Sep 17 00:00:00 2001 From: kyphii <8711258+kyphii@users.noreply.github.com> Date: Thu, 16 Feb 2023 00:39:31 -0500 Subject: [PATCH] Fix #19243: .park scenarios don't complete properly (#19411) * Check for .park scenario during scenario completion * Update changelog --------- Co-authored-by: Trevor Finney <8711258+finneyt@users.noreply.github.com> --- distribution/changelog.txt | 1 + src/openrct2/scenario/ScenarioRepository.cpp | 7 ++++++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/distribution/changelog.txt b/distribution/changelog.txt index 7d22eeb778..76bd90c61a 100644 --- a/distribution/changelog.txt +++ b/distribution/changelog.txt @@ -41,6 +41,7 @@ - Fix: [#19112] Text boxes not updated with empty strings in Track List, Server List, and Start Server windows. - Fix: [#19114] [Plugin] GameActionResult does not comply to API specification. - Fix: [#19136] SV6 saves with experimental RCT1 paths not imported correctly. +- Fix: [#19243] .park scenarios don't complete properly - Fix: [#19250] MusicObjects do not free their preview images. - Fix: [#19292] Overflow in totalRideValue. - Fix: [#19339] Incorrect import of crashed particles from SV4. diff --git a/src/openrct2/scenario/ScenarioRepository.cpp b/src/openrct2/scenario/ScenarioRepository.cpp index 9c25b568cf..c1fa517d8f 100644 --- a/src/openrct2/scenario/ScenarioRepository.cpp +++ b/src/openrct2/scenario/ScenarioRepository.cpp @@ -437,12 +437,12 @@ public: ScenarioIndexEntry* scenario = GetByFilename(scenarioFileName); - // Check if this is an RCTC scenario that corresponds to a known RCT1/2 scenario or vice versa, see #12626 if (scenario == nullptr) { const std::string scenarioBaseName = Path::GetFileNameWithoutExtension(scenarioFileName); const std::string scenarioExtension = Path::GetExtension(scenarioFileName); + // Check if this is an RCTC scenario that corresponds to a known RCT1/2 scenario or vice versa, see #12626 if (String::Equals(scenarioExtension, ".sea", true)) { // Get scenario using RCT2 style name of RCTC scenario @@ -453,6 +453,11 @@ public: // Get scenario using RCTC style name of RCT2 scenario scenario = GetByFilename((scenarioBaseName + ".sea").c_str()); } + // gScenarioFileName .Park scenarios is the full file path instead of just , so need to convert + else if (String::Equals(scenarioExtension, ".park", true)) + { + scenario = GetByFilename((scenarioBaseName + ".park").c_str()); + } } if (scenario != nullptr)