Use StringBuilder for GetString/GetStringWithArgs, as per upstream
Update dependent code as required
This commit is contained in:
@@ -376,25 +376,24 @@ void ShowErrorMessage(StringID summary_msg, StringID detailed_msg, WarningLevel
|
||||
|
||||
if (wl != WL_INFO) {
|
||||
/* Print message to console */
|
||||
char buf[DRAW_STRING_BUFFER];
|
||||
|
||||
if (textref_stack_size > 0) StartTextRefStackUsage(textref_stack_grffile, textref_stack_size, textref_stack);
|
||||
|
||||
char *b = GetString(buf, summary_msg, lastof(buf));
|
||||
std::string message = GetString(summary_msg);
|
||||
if (detailed_msg != INVALID_STRING_ID) {
|
||||
b += seprintf(b, lastof(buf), " ");
|
||||
GetString(b, detailed_msg, lastof(buf));
|
||||
message += ' ';
|
||||
message += GetString(detailed_msg);
|
||||
}
|
||||
if (extra_msg != INVALID_STRING_ID) {
|
||||
b += seprintf(b, lastof(buf), " ");
|
||||
GetString(b, extra_msg, lastof(buf));
|
||||
message += ' ';
|
||||
message += GetString(extra_msg);
|
||||
}
|
||||
|
||||
if (textref_stack_size > 0) StopTextRefStackUsage();
|
||||
|
||||
switch (wl) {
|
||||
case WL_WARNING: IConsolePrint(CC_WARNING, buf); break;
|
||||
default: IConsoleError(buf); break;
|
||||
case WL_WARNING: IConsolePrint(CC_WARNING, message.c_str()); break;
|
||||
default: IConsoleError(message.c_str()); break;
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user