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.6.0~163^2~499 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=c5bf60e3d929f531d53934bbca772d03cf716a0a;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 --- 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) {