fix(p2p): Fix compilation error in multiplayer port text

GCC complains about std::make_format_args using non-const references, so
we can't pass along the `get_console_peertopeer_port` directly.

Also replace `unsigned short` with `uint16_t` for clarity.
This commit is contained in:
Daniel López Guimaraes
2024-11-21 20:39:51 +00:00
parent a710bd985a
commit 06847b21e5
2 changed files with 8 additions and 7 deletions

View File

@@ -139,7 +139,8 @@ static WUPSConfigAPICallbackStatus ConfigMenuOpenedCallback(WUPSConfigCategoryHa
if (!res) return report_error(err);
{
std::string multiplayer_port_text = std::vformat(strings.multiplayer_port_display, std::make_format_args(get_console_peertopeer_port()));
uint16_t port = get_console_peertopeer_port();
std::string multiplayer_port_text = std::vformat(strings.multiplayer_port_display, std::make_format_args(port));
res = network_cat->add(WUPSConfigItemStub::Create(multiplayer_port_text), err);
if (!res) return report_error(err);
}