]> git.xonotic.org Git - xonotic/darkplaces.git/blobdiff - model_shared.c
Let the other players know if a connected player has timed out
[xonotic/darkplaces.git] / model_shared.c
index e70f47c2fb26359862c6b52a7c55242dd8e1712d..3213a050f8a015f6d195dafc91a5415852c6d2ed 100644 (file)
@@ -518,10 +518,10 @@ model_t *Mod_LoadModel(model_t *mod, qbool crash, qbool checkdisk)
                // all models use memory, so allocate a memory pool
                mod->mempool = Mem_AllocPool(mod->name, 0, NULL);
 
-               // call the apropriate loader
+               // We need to have a reference to the base model in case we're parsing submodels
                loadmodel = mod;
 
-               // Try matching magic bytes.
+               // Call the appropriate loader. Try matching magic bytes.
                for (i = 0; loader[i].Load; i++)
                {
                        // Headerless formats can just load based on extension. Otherwise match the magic string.
@@ -2885,7 +2885,7 @@ void Mod_VertexRangeFromElements(int numelements, const int *elements, int *firs
 
 void Mod_SetDrawSkyAndWater(model_t* mod)
 {
-       size_t j;
+       int j;
        uint64_t basematerialflags = 0;
        // by default assume there is no sky or water used in this model
        mod->DrawSky = NULL;
@@ -2936,7 +2936,12 @@ void Mod_MakeSortedSurfaces(model_t *mod)
 {
        // make an optimal set of texture-sorted batches to draw...
        int j, k;
-       Mod_MakeSortedSurfaces_qsortsurface_t *info = (Mod_MakeSortedSurfaces_qsortsurface_t*)R_FrameData_Alloc(mod->num_surfaces * sizeof(*info));
+       Mod_MakeSortedSurfaces_qsortsurface_t *info;
+
+       if(cls.state == ca_dedicated)
+               return;
+
+       info = (Mod_MakeSortedSurfaces_qsortsurface_t*)R_FrameData_Alloc(mod->num_surfaces * sizeof(*info));
        if (!mod->modelsurfaces_sorted)
                mod->modelsurfaces_sorted = (int *) Mem_Alloc(loadmodel->mempool, mod->num_surfaces * sizeof(*mod->modelsurfaces_sorted));
        // the goal is to sort by submodel (can't change which submodel a surface belongs to), and then by effects and textures