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

Function rndmapname

source/src/main.cpp:1035–1046  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1033VARFP(clockfix, 0, 0, 1, clockreset());
1034
1035const char *rndmapname()
1036{
1037 vector<char *> maps;
1038 listfiles("packages/maps/official", "cgz", maps);
1039 if (maps.length() > 0)
1040 {
1041 char *map = newstring(maps[rnd(maps.length())]);
1042 maps.deletearrays();
1043 return map;
1044 }
1045 else return "";
1046}
1047
1048#define AUTOSTARTPATH "config" PATHDIVS "autostart" PATHDIVS
1049

Callers 1

main.cppFile · 0.85

Calls 4

listfilesFunction · 0.85
newstringFunction · 0.85
deletearraysMethod · 0.80
lengthMethod · 0.45

Tested by

no test coverage detected