From 975b64a7fd3a3bd779eda40a09f4d6336cb1dc9c Mon Sep 17 00:00:00 2001 From: Aaron van Geffen Date: Thu, 24 Jul 2025 20:12:35 +0200 Subject: [PATCH] Fix custom RCT1 scenarios potentially being confused with official ones (#24832) --- distribution/changelog.txt | 1 + src/openrct2/rct1/S4Importer.cpp | 9 ++++++++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/distribution/changelog.txt b/distribution/changelog.txt index 0e2d3d96af..618fe77217 100644 --- a/distribution/changelog.txt +++ b/distribution/changelog.txt @@ -13,6 +13,7 @@ - Fix: [#24824] The Air Powered Vertical Coaster top section track piece has vertical tunnels (original bug). - Fix: [#24825] The River Rapids flat-to-gentle track piece tunnels are incorrect on the gentle side. - Fix: [#24826] The Junior Roller Coaster flat-to-steep track piece tunnels are incorrect. +- Fix: [#24831] Park names are being overwritten for custom RCT1 scenarios that use competition id slots. 0.4.24 (2025-07-05) ------------------------------------------------------------------------ diff --git a/src/openrct2/rct1/S4Importer.cpp b/src/openrct2/rct1/S4Importer.cpp index 94832290fa..f8dc1b4e48 100644 --- a/src/openrct2/rct1/S4Importer.cpp +++ b/src/openrct2/rct1/S4Importer.cpp @@ -2424,7 +2424,14 @@ namespace OpenRCT2::RCT1 if (scNumber != -1) { SourceDescriptor desc; - if (ScenarioSources::TryGetById(scNumber, &desc) && !desc.textObjectId.empty()) + // If no entry is found, this is a custom scenario + bool isOfficial = ScenarioSources::TryGetById(_s4.ScenarioSlotIndex, &desc); + + // Perform an additional name check if this is detected to be a competition scenario + if (isOfficial && desc.category == ScenarioCategory::competitions) + isOfficial = ScenarioSources::TryGetByName(_s4.ScenarioName, &desc); + + if (isOfficial && !desc.textObjectId.empty()) { auto& objManager = GetContext()->GetObjectManager();