MCPcopy Create free account
hub / github.com/assaultcube/AC / loadallmapmodels

Function loadallmapmodels

source/src/rendermodel.cpp:1096–1110  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1094}
1095
1096void loadallmapmodels() // try to find all mapmodels in packages/models/mapmodels
1097{
1098 vector<char *> files;
1099 listdirsrecursive("packages/models/mapmodels", files);
1100 files.sort(stringsort);
1101 loopvrev(files) if(files.inrange(i + 1) && !strcmp(files[i], files[i + 1])) delstring(files.remove(i + 1)); // remove doubles
1102 silentmodelloaderror = true;
1103 loopv(files)
1104 {
1105 const char *mn = files[i] + strlen("packages/models/");
1106 clientlogf("loadallmaps: %s %s", mn, loadmodel(mn) ? "loaded" : "failed to load");
1107 delstring(files[i]);
1108 }
1109 silentmodelloaderror = false;
1110}
1111COMMAND(loadallmapmodels, "");

Callers

nothing calls this directly

Calls 6

listdirsrecursiveFunction · 0.85
delstringFunction · 0.85
sortMethod · 0.80
inrangeMethod · 0.80
loopvrevFunction · 0.70
removeMethod · 0.45

Tested by

no test coverage detected