From c5bf60e3d929f531d53934bbca772d03cf716a0a Mon Sep 17 00:00:00 2001 From: divverent Date: Sun, 10 Apr 2011 19:07:28 +0000 Subject: [PATCH] break the net connection AFTER calling ClientDisconnect; this fixes issues with clienttype(self) in ClientDisconnect git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@11047 d7cf8633-e32d-0410-b094-e92efae38249 --- host.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/host.c b/host.c index 930eaf56..812c2146 100644 --- a/host.c +++ b/host.c @@ -445,7 +445,7 @@ void SV_DropClient(qboolean crash) if (host_client->netconnection) { - // free the client (the body stays around) + // tell the client to be gone if (!crash) { // LordHavoc: no opportunity for resending, so use unreliable 3 times @@ -459,9 +459,6 @@ void SV_DropClient(qboolean crash) NetConn_SendUnreliableMessage(host_client->netconnection, &buf, sv.protocol, 10000, false); NetConn_SendUnreliableMessage(host_client->netconnection, &buf, sv.protocol, 10000, false); } - // break the net connection - NetConn_Close(host_client->netconnection); - host_client->netconnection = NULL; } // call qc ClientDisconnect function @@ -478,6 +475,13 @@ void SV_DropClient(qboolean crash) prog->globals.server->self = saveSelf; } + if (host_client->netconnection) + { + // break the net connection + NetConn_Close(host_client->netconnection); + host_client->netconnection = NULL; + } + // if a download is active, close it if (host_client->download_file) { -- 2.39.2