[UserInfo] Clear overrides when user disconnects
This commit is contained in:
parent
854949a34f
commit
fe0cbacdea
@ -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<void(int)>(0x4AA430)(clientNum);
|
||||
}
|
||||
|
@ -7,15 +7,15 @@ namespace Components
|
||||
public:
|
||||
UserInfo();
|
||||
|
||||
static void ClearClientOverrides(int client);
|
||||
static void ClearAllOverrides();
|
||||
|
||||
private:
|
||||
using userInfoMap = std::unordered_map<std::string, std::string>;
|
||||
static std::unordered_map<int, userInfoMap> UserInfoOverrides;
|
||||
|
||||
static void SV_GetUserInfo_Stub(int index, char* buffer, int bufferSize);
|
||||
|
||||
static void ClearClientOverrides(int client);
|
||||
static void ClearAllOverrides();
|
||||
|
||||
static void AddScriptMethods();
|
||||
};
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user