diff --git a/Quake/gl_model.c b/Quake/gl_model.c index a7e22b4e..8033ac37 100644 --- a/Quake/gl_model.c +++ b/Quake/gl_model.c @@ -195,6 +195,20 @@ void Mod_ClearAll (void) } } +void Mod_ResetAll (void) +{ + int i; + qmodel_t *mod; + + for (i=0 , mod=mod_known ; ineedload) //otherwise Mod_ClearAll() did it already + TexMgr_FreeTexturesForOwner (mod); + memset(mod, 0, sizeof(qmodel_t)); + } + mod_numknown = 0; +} + /* ================== Mod_FindName diff --git a/Quake/gl_model.h b/Quake/gl_model.h index 01436269..9cd82696 100644 --- a/Quake/gl_model.h +++ b/Quake/gl_model.h @@ -449,6 +449,7 @@ typedef struct qmodel_s void Mod_Init (void); void Mod_ClearAll (void); +void Mod_ResetAll (void); // for gamedir changes (Host_Game_f) qmodel_t *Mod_ForName (const char *name, qboolean crash); void *Mod_Extradata (qmodel_t *mod); // handles caching void Mod_TouchModel (const char *name); diff --git a/Quake/host_cmd.c b/Quake/host_cmd.c index 34b3afb3..000ca78e 100644 --- a/Quake/host_cmd.c +++ b/Quake/host_cmd.c @@ -201,6 +201,7 @@ void Host_Game_f (void) //clear out and reload appropriate data Cache_Flush (); + Mod_ResetAll(); if (!isDedicated) { TexMgr_NewGame ();