From: cloudwalk Date: Sat, 26 Sep 2020 04:59:54 +0000 (+0000) Subject: cl_main: When establishing connection, disconnect from current server only if we... X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=c69acd2dc88840d2d83f7210fcfe4233a7ff2ac3;p=xonotic%2Fdarkplaces.git cl_main: When establishing connection, disconnect from current server only if we have a socket git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@12938 d7cf8633-e32d-0410-b094-e92efae38249 --- diff --git a/cl_main.c b/cl_main.c index 84cde98a..f877c406 100644 --- a/cl_main.c +++ b/cl_main.c @@ -529,14 +529,13 @@ void CL_EstablishConnection(const char *address, int firstarg) M_Update_Return_Reason(""); #endif - // Disconnect from the current server, or stop a running demo. - CL_Disconnect(); - // make sure the client ports are open before attempting to connect NetConn_UpdateSockets(); if (LHNETADDRESS_FromString(&cls.connect_address, address, 26000) && (cls.connect_mysocket = NetConn_ChooseClientSocketForAddress(&cls.connect_address))) { + // Disconnect from the current server, or stop a running demo. + CL_Disconnect(); cls.connect_trying = true; cls.connect_remainingtries = 3; cls.connect_nextsendtime = 0;