]> git.xonotic.org Git - xonotic/darkplaces.git/commitdiff
cl_main: When establishing connection, disconnect from current server only if we...
authorcloudwalk <cloudwalk@d7cf8633-e32d-0410-b094-e92efae38249>
Sat, 26 Sep 2020 04:59:54 +0000 (04:59 +0000)
committercloudwalk <cloudwalk@d7cf8633-e32d-0410-b094-e92efae38249>
Sat, 26 Sep 2020 04:59:54 +0000 (04:59 +0000)
git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@12938 d7cf8633-e32d-0410-b094-e92efae38249

cl_main.c

index 84cde98a8a4302964c898a53a2355731f59fb087..f877c4061e883e43464cb796d97e479d8aad4b0a 100644 (file)
--- 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;