clear the player slots properly when disconnecting

This commit is contained in:
Bill Currie 2003-05-30 20:16:30 +00:00
parent f061c47242
commit 42ade2c507
2 changed files with 6 additions and 4 deletions

View file

@ -492,11 +492,11 @@ CL_Disconnect (void)
Team_ResetTimers ();
// remove player info strings
for (i = 0; i < MAX_CLIENTS; i++)
if (cl.players[i].userinfo) {
for (i = 0; i < MAX_CLIENTS; i++) {
if (cl.players[i].userinfo)
Info_Destroy (cl.players[i].userinfo);
cl.players[i].userinfo = 0;
}
memset (&cl.players[i], 0, sizeof (cl.players[i]));
}
cl.worldmodel = NULL;
cl.validsequence = 0;
}

View file

@ -1040,6 +1040,8 @@ CL_UpdateUserinfo (void)
CL_ProcessUserInfo (slot, player);
} else {
// the server dropped the client
if (player->userinfo)
Info_Destroy (player->userinfo);
memset (player, 0, sizeof (*player));
}
}