diff --git a/source/src/main.cpp b/source/src/main.cpp index 8f243816..37084ecd 100644 --- a/source/src/main.cpp +++ b/source/src/main.cpp @@ -874,18 +874,11 @@ VARFP(clockfix, 0, 0, 1, clockreset()); const char *rndmapname() { - // "ac_depot_classic", - static const char * const mapnames[] = { - "ac_aqueous", "ac_arabian", "ac_arctic", "ac_arid", "ac_avenue", - "ac_complex", "ac_depot", "ac_desert", "ac_desert2", "ac_desert3", - "ac_douze", "ac_edifice", "ac_elevation", "ac_gothic", "ac_iceroad", - "ac_industrial", "ac_ingress", "ac_keller", "ac_mines", "ac_outpost", - "ac_power", "ac_rattrap", "ac_scaffold", "ac_shine", "ac_snow", - "ac_stellar", "ac_sunset", "ac_toxic", "ac_urban", "ac_werk", - }; - int l = sizeof(mapnames)/sizeof(mapnames[0]); - int n = rnd(l); - return mapnames[n]; + vector maps; + listfiles("packages/maps/official", "cgz", maps); + char *map = newstring(maps[rnd(maps.length())]); + maps.deletearrays(); + return map; } extern void connectserv(char *, int *, char *);