mirror of https://github.com/OpenTTD/OpenTTD
Fix: [NewGRF] String parameter stack and case selection were not processed for control code 0x81. (#13851)
parent
a4f9977d18
commit
a4f3ddae5f
|
@ -840,6 +840,13 @@ static void ProcessNewGRFStringControlCode(char32_t scc, const char *&str, TextR
|
||||||
params.emplace_back(stack.PopUnsignedWord());
|
params.emplace_back(stack.PopUnsignedWord());
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case SCC_NEWGRF_STRINL: {
|
||||||
|
StringID stringid = Utf8Consume(str);
|
||||||
|
/* We also need to handle the substring's stack usage. */
|
||||||
|
HandleNewGRFStringControlCodes(GetStringPtr(stringid), stack, params);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
case SCC_NEWGRF_PRINT_WORD_STRING_ID: {
|
case SCC_NEWGRF_PRINT_WORD_STRING_ID: {
|
||||||
StringID stringid = MapGRFStringID(stack.grffile->grfid, GRFStringID{stack.PopUnsignedWord()});
|
StringID stringid = MapGRFStringID(stack.grffile->grfid, GRFStringID{stack.PopUnsignedWord()});
|
||||||
params.emplace_back(stringid);
|
params.emplace_back(stringid);
|
||||||
|
@ -884,9 +891,6 @@ char32_t RemapNewGRFStringControlCode(char32_t scc, const char **str)
|
||||||
case SCC_NEWGRF_PRINT_QWORD_CURRENCY:
|
case SCC_NEWGRF_PRINT_QWORD_CURRENCY:
|
||||||
return SCC_CURRENCY_LONG;
|
return SCC_CURRENCY_LONG;
|
||||||
|
|
||||||
case SCC_NEWGRF_PRINT_WORD_STRING_ID:
|
|
||||||
return SCC_NEWGRF_PRINT_WORD_STRING_ID;
|
|
||||||
|
|
||||||
case SCC_NEWGRF_PRINT_WORD_DATE_LONG:
|
case SCC_NEWGRF_PRINT_WORD_DATE_LONG:
|
||||||
case SCC_NEWGRF_PRINT_DWORD_DATE_LONG:
|
case SCC_NEWGRF_PRINT_DWORD_DATE_LONG:
|
||||||
return SCC_DATE_LONG;
|
return SCC_DATE_LONG;
|
||||||
|
|
|
@ -1133,6 +1133,8 @@ static void FormatString(StringBuilder &builder, const char *str_arg, StringPara
|
||||||
} else {
|
} else {
|
||||||
str_stack.push(ptr);
|
str_stack.push(ptr);
|
||||||
}
|
}
|
||||||
|
case_index = next_substr_case_index;
|
||||||
|
next_substr_case_index = 0;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue