identity_fix: Fix error on player disconnect

This commit is contained in:
Jackzie 2021-06-30 18:30:57 -05:00
parent fd63f7ca8c
commit d1a09817f1
No known key found for this signature in database
GPG key ID: 1E834FE36520537A
2 changed files with 5 additions and 3 deletions

View file

@ -299,10 +299,12 @@ public Action Event_PlayerFirstSpawn(Event event, const char[] name, bool dontBr
}
public Action Event_PlayerDisconnect(Event event, const char[] name, bool dontBroadcast) {
int client = GetClientOfUserId(event.GetInt("userid"));
if(client > 0) {
g_Models[client][0] = '\0';
if(!IsFakeClient(client) && survivors > 0)
survivors--;
}
}
public void Frame_CheckClient(int userid) {
int client = GetClientOfUserId(userid);
if(client > 0 && GetClientTeam(client) == 2 && !IsFakeClient(client)) {