From d75c361cc46951ea71be8a15e89df456f201c968 Mon Sep 17 00:00:00 2001 From: fed <58637860+fedddddd@users.noreply.github.com> Date: Thu, 22 Dec 2022 00:28:20 +0100 Subject: [PATCH] Clean gametype --- src/client/component/discord.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/client/component/discord.cpp b/src/client/component/discord.cpp index b8587789..7677662f 100644 --- a/src/client/component/discord.cpp +++ b/src/client/component/discord.cpp @@ -67,9 +67,12 @@ namespace discord if (game::environment::is_mp()) { + static char clean_gametype[0x80] = {0}; const auto gametype = game::UI_GetGameTypeDisplayName( game::Dvar_FindVar("g_gametype")->current.string); - strcpy_s(details, 0x80, utils::string::va("%s on %s", gametype, mapname)); + utils::string::strip(gametype, + clean_gametype, sizeof(clean_gametype)); + strcpy_s(details, 0x80, utils::string::va("%s on %s", clean_gametype, mapname)); static char clean_hostname[0x80] = {0}; utils::string::strip(game::Dvar_FindVar("sv_hostname")->current.string,