Use StringBuilder for GetString/GetStringWithArgs, as per upstream

Update dependent code as required
This commit is contained in:
Jonathan G Rennison
2024-01-05 21:12:54 +00:00
parent 1b7a5372ec
commit f034714559
61 changed files with 1064 additions and 1228 deletions

View File

@@ -1205,10 +1205,8 @@ static void DrawInstructionString(const TraceRestrictProgram *prog, TraceRestric
SetDParam(1, selected ? STR_TRACE_RESTRICT_WHITE : STR_EMPTY);
} else {
auto insert_warning = [&](uint dparam_index, StringID warning) {
char buf[256];
auto tmp_params = MakeParameters(GetDParam(dparam_index));
char *end = GetStringWithArgs(buf, warning, tmp_params, lastof(buf));
_temp_special_strings[0].assign(buf, end);
_temp_special_strings[0] = GetStringWithArgs(warning, tmp_params);
SetDParam(dparam_index, SPECSTR_TEMP_START);
};