1
0
mirror of https://github.com/OpenRCT2/OpenRCT2 synced 2025-12-24 00:03:11 +01:00

Fix #12944. Mistake from refactor meant formatter optimised away (#12961)

Not sure why it should get optimised away but this will fix the crashes.
This commit is contained in:
Duncan
2020-09-18 09:25:17 +01:00
committed by GitHub
parent c72f547606
commit da82144bfb
4 changed files with 8 additions and 4 deletions

View File

@@ -468,7 +468,8 @@ static void widget_groupbox_draw(rct_drawpixelinfo* dpi, rct_window* w, rct_widg
utf8 buffer[512] = { 0 };
format_string(buffer, sizeof(buffer), stringId, formatArgs);
auto ft = Formatter().Add<utf8*>(buffer);
auto ft = Formatter();
ft.Add<utf8*>(buffer);
gfx_draw_string_left(dpi, STR_STRING, ft.Data(), colour, { l, t });
textRight = l + gfx_get_string_width(buffer) + 1;
}

View File

@@ -415,7 +415,8 @@ static void window_staff_list_tooldown(rct_window* w, rct_widgetindex widgetInde
}
else
{
auto ft = Formatter().Add<rct_string_id>(StaffNamingConvention[selectedPeepType].plural);
auto ft = Formatter();
ft.Add<rct_string_id>(StaffNamingConvention[selectedPeepType].plural);
context_show_error(STR_NO_THING_IN_PARK_YET, STR_NONE, ft);
}
}

View File

@@ -672,7 +672,8 @@ namespace OpenRCT2
catch (const UnsupportedRCTCFlagException& e)
{
auto windowManager = _uiContext->GetWindowManager();
auto ft = Formatter().Add<uint16_t>(e.Flag);
auto ft = Formatter();
ft.Add<uint16_t>(e.Flag);
windowManager->ShowError(STR_FAILED_TO_LOAD_IMCOMPATIBLE_RCTC_FLAG, STR_NONE, ft);
}
catch (const std::exception& e)

View File

@@ -2443,7 +2443,8 @@ void NetworkBase::Client_Handle_GAMESTATE(NetworkConnection& connection, Network
{
log_info("Wrote desync report to '%s'", outputFile.c_str());
auto ft = Formatter().Add<char*>(uniqueFileName);
auto ft = Formatter();
ft.Add<char*>(uniqueFileName);
char str_desync[1024];
format_string(str_desync, sizeof(str_desync), STR_DESYNC_REPORT, ft.Data());