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++)
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;