From a9584ad7973c9264a686662a6febb3be889cdd3d Mon Sep 17 00:00:00 2001 From: Ted John Date: Fri, 12 Mar 2021 20:08:56 +0000 Subject: [PATCH] Fix #14266: [Plugin] {STRINGID} format is not applied --- src/openrct2/localisation/Formatting.cpp | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/src/openrct2/localisation/Formatting.cpp b/src/openrct2/localisation/Formatting.cpp index 2417bb406e..6c64e6e9f6 100644 --- a/src/openrct2/localisation/Formatting.cpp +++ b/src/openrct2/localisation/Formatting.cpp @@ -680,15 +680,24 @@ namespace OpenRCT2 if (argIndex < args.size()) { const auto& arg = args[argIndex++]; - if (auto stringid = std::get_if(&arg)) + std::optional stringId; + if (auto value16 = std::get_if(&arg)) { - if (IsRealNameStringId(*stringid)) + stringId = *value16; + } + else if (auto value32 = std::get_if(&arg)) + { + stringId = *value32; + } + if (stringId) + { + if (IsRealNameStringId(*stringId)) { - FormatRealName(ss, *stringid); + FormatRealName(ss, *stringId); } else { - auto subfmt = GetFmtStringById(*stringid); + auto subfmt = GetFmtStringById(*stringId); FormatStringAny(ss, subfmt, args, argIndex); } }