From eb7b5feab9cbf52cae49059aa28e5871bdf1e10a Mon Sep 17 00:00:00 2001 From: Michael Steenbeek <1478678+Gymnasiast@users.noreply.github.com> Date: Sun, 13 Sep 2026 14:23:30 +0200 Subject: [PATCH] Fix #17409: Game defaults to pounds in Canada (#27120) --- distribution/changelog.txt | 1 + src/openrct2/platform/Platform.Common.cpp | 11 +++++++++++ 2 files changed, 12 insertions(+) diff --git a/distribution/changelog.txt b/distribution/changelog.txt index c9b62a12e3..94bfb2535f 100644 --- a/distribution/changelog.txt +++ b/distribution/changelog.txt @@ -4,6 +4,7 @@ - Improved: [#26947] Rain is now drawn next to the bottom info panels (in RCT2 style). - Change: [#27100] Negative G-forces no longer turn red in the stats window and graph when below -2.50. - Fix: [#1514] Wrong capitalisation for strings in the Guest List window. +- Fix: [#17409] When reading system settings, non-US dollar currencies are not recognised correctly. - Fix: [#19754, #27109] Some rides in RCT1 saves have a wrong number of cars per train. - Fix: [#21320] RCT1 allows more cars per train on some rides than OpenRCT2. - Fix: [#21576] RCT1 Wooden wild mouse track designs with 2-car trains are not imported correctly. diff --git a/src/openrct2/platform/Platform.Common.cpp b/src/openrct2/platform/Platform.Common.cpp index 45354c48d4..fe6a2ff1b2 100644 --- a/src/openrct2/platform/Platform.Common.cpp +++ b/src/openrct2/platform/Platform.Common.cpp @@ -44,6 +44,14 @@ static constexpr std::array _prohibitedCharacters = { '<', '>', '*', '\\', ':', static constexpr std::array _prohibitedCharacters = { '/' }; #endif +// A lot of countries use a dollar as their currency. Make sure these are mapped to the generic dollar currency +// instead of defaulting to pounds sterling. The US Dollar, Hong Kong Dollar and New Taiwan Dollar are omitted deliberately +// as they do exist in OpenRCT2. +static constexpr std::array kDollarCurrencies = { + "AUD", "BBD", "BMD", "BND", "BSD", "BZD", "CAD", "FJD", "GYD", "JMD", "KID", + "KYD", "LRD", "NAD", "NZD", "SBD", "SGD", "SRD", "TTD", "TVD", "XCD", +}; + namespace OpenRCT2::Platform { CurrencyType GetCurrencyValue(const char* currCode) @@ -61,6 +69,9 @@ namespace OpenRCT2::Platform } } + if (std::ranges::find(kDollarCurrencies, u8string_view(currCode, 3)) != kDollarCurrencies.end()) + return CurrencyType::dollars; + return CurrencyType::pounds; }