From 7add84442f896b85111a025e478f4f162b7115f4 Mon Sep 17 00:00:00 2001 From: Diavolo Date: Sat, 1 Jan 2022 22:21:25 +0100 Subject: [PATCH] Allow to unmute using guid --- src/Components/Modules/Chat.cpp | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/src/Components/Modules/Chat.cpp b/src/Components/Modules/Chat.cpp index 35b0609f..c10df623 100644 --- a/src/Components/Modules/Chat.cpp +++ b/src/Components/Modules/Chat.cpp @@ -264,22 +264,27 @@ namespace Components const auto* cmd = params->get(0); if (params->length() < 2) { - Logger::Print("Usage: %s \n%s all = unmute everyone\n", cmd, cmd); + Logger::Print("Usage: %s \n%s all = unmute everyone\n", cmd, cmd); return; } const auto* client = Game::SV_GetPlayerByNum(); - if (client == nullptr) + + if (client != nullptr) { - if (params->get(1) == "all"s) - { - Logger::Print("All players were unmuted\n"); - Chat::MuteList.clear(); - } + Chat::UnmuteClient(client); + return; + } + + if (params->get(1) == "all"s) + { + Logger::Print("All players were unmuted\n"); + Chat::MuteList.clear(); } else { - Chat::UnmuteClient(client); + const auto SteamID = std::strtoull(params->get(1), nullptr, 16); + Chat::MuteList.erase(SteamID); } }); }