Fix #14266: [Plugin] {STRINGID} format is not applied

This commit is contained in:
Ted John 2021-03-12 20:08:56 +00:00 committed by GitHub
parent f0dc28e9fc
commit a9584ad797
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 13 additions and 4 deletions

View File

@ -680,15 +680,24 @@ namespace OpenRCT2
if (argIndex < args.size())
{
const auto& arg = args[argIndex++];
if (auto stringid = std::get_if<uint16_t>(&arg))
std::optional<rct_string_id> stringId;
if (auto value16 = std::get_if<uint16_t>(&arg))
{
if (IsRealNameStringId(*stringid))
stringId = *value16;
}
else if (auto value32 = std::get_if<int32_t>(&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);
}
}