]> de.git.xonotic.org Git - xonotic/darkplaces.git/blobdiff - model_shared.c
- Fixed JPEG support on Mac OS X
[xonotic/darkplaces.git] / model_shared.c
index 6addcf6250fc095045d866b9b2cb15e4cf70aa2c..6c31882d3276bd8f7e1c872b1e5b62c0b1fd4077 100644 (file)
@@ -197,7 +197,7 @@ static void mod_newmap(void)
        msurface_t *surf;
        int i, surfnum, ssize, tsize;
 
-       if (!cl_stainmapsclearonload.integer)
+       if (!cl_stainmaps_clearonload.integer)
                return;
 
        for (i=0; i<MAX_MOD_KNOWN; i++)
@@ -308,6 +308,14 @@ static model_t *Mod_LoadModel(model_t *mod, qboolean crash, qboolean checkdisk,
        Con_DPrintf("loading model %s\n", mod->name);
        // LordHavoc: unload the existing model in this slot (if there is one)
        Mod_UnloadModel(mod);
+       if (isworldmodel)
+       {
+               // clear out any stale submodels lying around, as well as the old world model itself
+               int i;
+               for (i = 0;i < MAX_MOD_KNOWN;i++)
+                       if (mod_known[i].isworldmodel)
+                               Mod_UnloadModel(mod_known + i);
+       }
 
        // load the model
        mod->isworldmodel = isworldmodel;