]> git.xonotic.org Git - xonotic/darkplaces.git/blobdiff - cl_main.c
cl_main: Disconnect when connection is established, only if we're already connected
[xonotic/darkplaces.git] / cl_main.c
index 84cde98a8a4302964c898a53a2355731f59fb087..fb456b06c4fedc0fbf53b34c03a9fc8d2c476c3e 100644 (file)
--- a/cl_main.c
+++ b/cl_main.c
@@ -529,14 +529,12 @@ 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.
                cls.connect_trying = true;
                cls.connect_remainingtries = 3;
                cls.connect_nextsendtime = 0;
@@ -2923,6 +2921,8 @@ void CL_Init (void)
        {
                Con_Printf("Initializing client\n");
 
+               Cvar_SetValueQuick(&host_isclient, 1);
+
                R_Modules_Init();
                Palette_Init();
 #ifdef CONFIG_MENU