From ff58672afad76f22a1dcc4674625c476ecc7743a Mon Sep 17 00:00:00 2001 From: 0TheSpy <5511c282@opayq.com> Date: Thu, 10 Nov 2022 03:02:35 +0300 Subject: [PATCH] Update Hooks.hpp --- SpyCustom/Hooks.hpp | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/SpyCustom/Hooks.hpp b/SpyCustom/Hooks.hpp index f32f3ec..a48e792 100644 --- a/SpyCustom/Hooks.hpp +++ b/SpyCustom/Hooks.hpp @@ -305,16 +305,16 @@ void __fastcall hkShutdown(void* thisptr, void* unk1, void* unk2, const char* re typedef const bool(__thiscall* pSendNetMsg)(void*, INetMessage*, bool, bool); pSendNetMsg oSendNetMsg; bool __fastcall hkSendNetMsg(void* channel, uint32_t, INetMessage* msg, bool reliable, bool voice) -{ +{ if (*g_Options.changing_name && msg->GetType() == net_SetConVar) - { - printfdbg("sendnetmsg net_SetConVar %d\n", *g_Options.changing_name); - *g_Options.changing_name -= 1; - - if (*g_Options.changing_name) { - printfdbg("blocking packet\n"); + { + if (*g_Options.changing_name > 1) { + *g_Options.changing_name = 0; + printfdbg("Blocking net_SetConVar packet\n"); return false; } + + *g_Options.changing_name += 1; } return oSendNetMsg(channel, msg, reliable, voice);