]> 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 b7f26af02e1e126d8869ad12b70f1527d3ad2bb4..fb456b06c4fedc0fbf53b34c03a9fc8d2c476c3e 100644 (file)
--- a/cl_main.c
+++ b/cl_main.c
@@ -147,7 +147,7 @@ void CL_ClearState(void)
 
        // tweak these if the game runs out
        cl.max_csqcrenderentities = 0;
-       cl.max_entities = MAX_ENITIES_INITIAL;
+       cl.max_entities = MAX_ENTITIES_INITIAL;
        cl.max_static_entities = MAX_STATICENTITIES;
        cl.max_effects = MAX_EFFECTS;
        cl.max_beams = MAX_BEAMS;
@@ -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