From 372bf8402292c7ac2853031808d751803d2433ef Mon Sep 17 00:00:00 2001 From: havoc Date: Mon, 24 Oct 2005 04:22:16 +0000 Subject: [PATCH] slightly optimized Mod_ForName to make less calls to Mod_LoadModel git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@5763 d7cf8633-e32d-0410-b094-e92efae38249 --- model_shared.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/model_shared.c b/model_shared.c index 0fee3712..e100139c 100644 --- a/model_shared.c +++ b/model_shared.c @@ -163,7 +163,8 @@ model_t *Mod_LoadModel(model_t *mod, qboolean crash, qboolean checkdisk, qboolea Con_DPrintf("loading model %s\n", mod->name); // LordHavoc: unload the existing model in this slot (if there is one) - Mod_UnloadModel(mod); + if (mod->loaded) + Mod_UnloadModel(mod); // load the model mod->isworldmodel = isworldmodel; @@ -322,7 +323,7 @@ model_t *Mod_ForName(const char *name, qboolean crash, qboolean checkdisk, qbool { model_t *model; model = Mod_FindName(name); - if (!model->loaded || checkdisk) + if (model->name[0] != '*' && (!model->loaded || checkdisk)) Mod_LoadModel(model, crash, checkdisk, isworldmodel); return model; } -- 2.39.2