]> de.git.xonotic.org Git - xonotic/darkplaces.git/blobdiff - cl_main.c
Make sure the server<->client interpreters run.
[xonotic/darkplaces.git] / cl_main.c
index ca6731aced0a95264487b884f0d79421f63d008a..b0c913d054fa1e0092262e219ba89f46c56b8664 100644 (file)
--- a/cl_main.c
+++ b/cl_main.c
@@ -141,7 +141,6 @@ void CL_ClearState(void)
        cl.max_lightstyle = MAX_LIGHTSTYLES;
        cl.max_brushmodel_entities = MAX_EDICTS;
        cl.max_particles = MAX_PARTICLES_INITIAL; // grows dynamically
-       cl.max_decals = MAX_DECALS_INITIAL; // grows dynamically
        cl.max_showlmps = 0;
 
        cl.num_dlights = 0;
@@ -158,7 +157,6 @@ void CL_ClearState(void)
        cl.lightstyle = (lightstyle_t *)Mem_Alloc(cls.levelmempool, cl.max_lightstyle * sizeof(lightstyle_t));
        cl.brushmodel_entities = (int *)Mem_Alloc(cls.levelmempool, cl.max_brushmodel_entities * sizeof(int));
        cl.particles = (particle_t *) Mem_Alloc(cls.levelmempool, cl.max_particles * sizeof(particle_t));
-       cl.decals = (decal_t *) Mem_Alloc(cls.levelmempool, cl.max_decals * sizeof(decal_t));
        cl.showlmps = NULL;
 
        // LadyHavoc: have to set up the baseline info for alpha and other stuff
@@ -429,15 +427,13 @@ void CL_EstablishConnection(const char *host, int firstarg)
 #ifdef CONFIG_MENU
        M_Update_Return_Reason("");
 #endif
-       cls.demonum = -1;
-
-       // stop demo loop in case this fails
-       if (cls.demoplayback)
-               CL_StopPlayback();
 
        // if downloads are running, cancel their finishing action
        Curl_Clear_forthismap();
 
+       // 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();
 
@@ -2423,6 +2419,7 @@ static void CL_MeshEntities_Init(void)
                Matrix4x4_CreateIdentity(&ent->render.matrix);
                CL_UpdateRenderEntity(&ent->render);
        }
+       cl_meshentities[MESH_UI].render.flags = RENDER_NOSELFSHADOW;
        R_RegisterModule("cl_meshentities", CL_MeshEntities_Restart, CL_MeshEntities_Restart, CL_MeshEntities_Restart, CL_MeshEntities_Restart, CL_MeshEntities_Restart);
 }