The random map will be picked from the packages/maps/official dir instead of a list

git-svn-id: svn://svn.code.sf.net/p/actiongame/code/trunk/ac@7133 e016b1c5-ed68-44aa-a2f7-31cac88cffde
This commit is contained in:
aerkefiende
2013-01-22 21:39:18 +00:00
parent 6be22f7c97
commit 138e1a1acb
+5 -12
View File
@@ -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<char *> maps;
listfiles("packages/maps/official", "cgz", maps);
char *map = newstring(maps[rnd(maps.length())]);
maps.deletearrays();
return map;
}
extern void connectserv(char *, int *, char *);