fix loadallmapmodels

now also loads models with paths that include '.'
This commit is contained in:
ac-stef
2016-10-13 23:42:04 +02:00
parent 41ff4cf583
commit 985048efda
+3 -1
View File
@@ -1125,7 +1125,9 @@ void loadallmapmodels() // try to find all mapmodels in packages/models/mapmode
{
vector<char *> files;
listfilesrecursive("packages/models/mapmodels", files);
loopvrev(files) if(strchr(files[i], '.')) delstring(files.remove(i)); // poor man's solution to remove ordinary files from the list: remove everything containing '.'
char *r = NULL;
loopvrev(files) if((r = strrchr(files[i], '/'))) *r = '\0'; // cut off filename and last '/'
loopvrev(files) if(!strchr(files[i], '/')) delstring(files.remove(i)); // require minimum path depth of two
files.sort(stringsort);
loopvrev(files) if(files.inrange(i + 1) && !strcmp(files[i], files[i + 1])) delstring(files.remove(i + 1)); // remove doubles
loopv(files)