From 985048efda2407a89bfba2cf01407071744a7857 Mon Sep 17 00:00:00 2001 From: ac-stef Date: Thu, 13 Oct 2016 23:42:04 +0200 Subject: [PATCH] fix loadallmapmodels now also loads models with paths that include '.' --- source/src/rendermodel.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/source/src/rendermodel.cpp b/source/src/rendermodel.cpp index b0b5ff56..a441fd7c 100644 --- a/source/src/rendermodel.cpp +++ b/source/src/rendermodel.cpp @@ -1125,7 +1125,9 @@ void loadallmapmodels() // try to find all mapmodels in packages/models/mapmode { vector 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)