diff --git a/src/Components/Modules/Bots.cpp b/src/Components/Modules/Bots.cpp index e89c73a2..7f0952d9 100644 --- a/src/Components/Modules/Bots.cpp +++ b/src/Components/Modules/Bots.cpp @@ -311,10 +311,13 @@ namespace Components * Should be called when a client drops from the server * but not "between levels" (Quake-III-Arena) */ - void Bots::ClientDisconnect_Hk(int clientNum) + void Bots::ClientDisconnect_Hk(const int clientNum) { g_botai[clientNum].active = false; + // Clear the overrides for UserInfo + UserInfo::ClearClientOverrides(clientNum); + // Call original function Utils::Hook::Call(0x4AA430)(clientNum); } diff --git a/src/Components/Modules/UserInfo.hpp b/src/Components/Modules/UserInfo.hpp index cdf3cfd2..78b8e1c7 100644 --- a/src/Components/Modules/UserInfo.hpp +++ b/src/Components/Modules/UserInfo.hpp @@ -7,15 +7,15 @@ namespace Components public: UserInfo(); + static void ClearClientOverrides(int client); + static void ClearAllOverrides(); + private: using userInfoMap = std::unordered_map; static std::unordered_map UserInfoOverrides; static void SV_GetUserInfo_Stub(int index, char* buffer, int bufferSize); - static void ClearClientOverrides(int client); - static void ClearAllOverrides(); - static void AddScriptMethods(); }; }