From: divverent Date: Sun, 10 Apr 2011 19:07:28 +0000 (+0000) Subject: break the net connection AFTER calling ClientDisconnect; this fixes issues with clien... X-Git-Tag: xonotic-v0.5.0~279 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=8db0b73edf8c5ccf1dd8ef421208aacbf7636cb3;p=xonotic%2Fdarkplaces.git 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 ::stable-branch::merge=c5bf60e3d929f531d53934bbca772d03cf716a0a --- 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) {