From 2a79fe000e562083084b1f28869baf65a0d9c2da Mon Sep 17 00:00:00 2001 From: m Date: Tue, 1 Mar 2022 18:07:22 -0600 Subject: [PATCH] fix up discord rpc --- src/client/component/discord.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/client/component/discord.cpp b/src/client/component/discord.cpp index 0bd8c4dc..561c402a 100644 --- a/src/client/component/discord.cpp +++ b/src/client/component/discord.cpp @@ -52,15 +52,17 @@ namespace discord char clean_hostname[0x100] = {0}; utils::string::strip(game::Dvar_FindVar("sv_hostname")->current.string, clean_hostname, sizeof(clean_hostname)); - auto max_clients = game::Dvar_FindVar("sv_maxclients")->current.integer; + auto max_clients = party::server_client_count(); + auto clients = party::get_client_count(); + // When true, we are in Private Match if (game::SV_Loaded()) { strcpy_s(clean_hostname, "Private Match"); - max_clients = party::server_client_count(); + max_clients = game::Dvar_FindVar("sv_maxclients")->current.integer; + clients = *reinterpret_cast(0x14621BE00); } - auto clients = *reinterpret_cast(0x14621BE00); discord_presence.partySize = clients; discord_presence.partyMax = max_clients; discord_presence.state = clean_hostname;