From 1a13cdcc57d896312e8ca8ee409b837650e0eeb9 Mon Sep 17 00:00:00 2001 From: Michael Steenbeek Date: Sun, 11 Feb 2024 21:51:23 +0100 Subject: [PATCH] Fix #21220: Localised park name not used when loading SC4 --- distribution/changelog.txt | 1 + src/openrct2/rct1/S4Importer.cpp | 10 ++++++++++ 2 files changed, 11 insertions(+) diff --git a/distribution/changelog.txt b/distribution/changelog.txt index 02b9b3f0c4..5b1be3f7ab 100644 --- a/distribution/changelog.txt +++ b/distribution/changelog.txt @@ -4,6 +4,7 @@ - Improved: [#21356] Resize the title bar when moving between displays with different scaling factors on Windows systems. - Fix: [#18963] Research table in parks from Loopy Landscapes is imported incorrectly. - Fix: [#20907] RCT1/AA scenarios use the 4-across train for the Inverted Roller Coaster. +- Fix: [#21220] When creating a new park from a SC4 file, the localised park name is not applied. - Fix: [#21330] Tooltips from dropdown widgets have the wrong position. - Fix: [#21332] Mini Helicopters and Monorail Cycles ride types are swapped in research within RCT1 scenarios. - Fix: [#21347] Too many options are hidden if the platform has no file picker. diff --git a/src/openrct2/rct1/S4Importer.cpp b/src/openrct2/rct1/S4Importer.cpp index 43676e8db3..fde6dd959a 100644 --- a/src/openrct2/rct1/S4Importer.cpp +++ b/src/openrct2/rct1/S4Importer.cpp @@ -2297,6 +2297,7 @@ namespace RCT1 void ImportScenarioNameDetails(GameState_t& gameState) { std::string name = String::ToStd(_s4.ScenarioName); + std::string parkName; std::string details; int32_t scNumber = _s4.ScenarioSlotIndex; @@ -2312,6 +2313,10 @@ namespace RCT1 { name = String::ToStd(LanguageGetString(localisedStringIds[0])); } + if (localisedStringIds[1] != STR_NONE) + { + parkName = String::ToStd(LanguageGetString(localisedStringIds[1])); + } if (localisedStringIds[2] != STR_NONE) { details = String::ToStd(LanguageGetString(localisedStringIds[2])); @@ -2322,6 +2327,11 @@ namespace RCT1 gameState.ScenarioName = std::move(name); gameState.ScenarioDetails = std::move(details); + if (_isScenario && !parkName.empty()) + { + auto& park = GetContext()->GetGameState()->GetPark(); + park.Name = std::move(parkName); + } } void ImportScenarioObjective(GameState_t& gameState)