cache missing models

(otherwise, it would try to load them over and over again)

git-svn-id: svn://svn.code.sf.net/p/actiongame/code/trunk/ac@6914 e016b1c5-ed68-44aa-a2f7-31cac88cffde
This commit is contained in:
sireus
2012-10-10 18:31:44 +00:00
parent 7fa7e615d1
commit cc8121066a
+10 -2
View File
@@ -101,6 +101,7 @@ COMMAND(mapmodel, "iiiss");
COMMAND(mapmodelreset, "");
hashtable<const char *, model *> mdllookup;
model *nomodel = NULL;
model *loadmodel(const char *name, int i)
{
@@ -131,10 +132,17 @@ model *loadmodel(const char *name, int i)
}
}
popscontext();
if(!loadingmodel) return NULL;
if(!loadingmodel)
{
conoutf(_("failed to load model %s"), name);
if(!nomodel) nomodel = new md2("nomodel");
m = nomodel;
mdllookup.access(newstring(name), m);
}
else mdllookup.access(m->name(), m);
loadingmodel = NULL;
mdllookup.access(m->name(), m);
}
if(m == nomodel) return NULL;
if(mapmodels.inrange(i) && !mapmodels[i].m) mapmodels[i].m = m;
return m;
}