From 42ade2c50790a9a3428dcdcf5ba4d47586d1c444 Mon Sep 17 00:00:00 2001 From: Bill Currie Date: Fri, 30 May 2003 20:16:30 +0000 Subject: [PATCH] clear the player slots properly when disconnecting --- qw/source/cl_main.c | 8 ++++---- qw/source/cl_parse.c | 2 ++ 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/qw/source/cl_main.c b/qw/source/cl_main.c index 9e4797f58..adf0764d2 100644 --- a/qw/source/cl_main.c +++ b/qw/source/cl_main.c @@ -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; } diff --git a/qw/source/cl_parse.c b/qw/source/cl_parse.c index 2398f67ad..3f2bc4f15 100644 --- a/qw/source/cl_parse.c +++ b/qw/source/cl_parse.c @@ -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)); } }