string types = s;
types = strreplace("team", "tdm ft", types);
types = strreplace("ffa", "dm lms ka", types);
- if(strstrofs(s, "tournament", 0) < 0 && strstrofs(s, "tdm", 0) >= 0) // larger team map, support additional gamemodes!
+ if(strstrofs(types, "tournament", 0) < 0 && strstrofs(types, "tdm", 0) >= 0) // larger team map, support additional gamemodes!
types = cons(types, "ca kh");
FOREACH_WORD(types, true,
{
return false;
}
-#if defined(CSQC) || defined(MENUQC)
-string(string filename) whichpack = #503;
-#endif
string _MapInfo_CheckArenaFile(string pFilename, string pMapname)
{
// returns the file name if valid, otherwise returns ""
return r;
}
+bool MapReadSizes(string map)
+{
+ // TODO: implement xonotic#28 / xonvote 172 (sizes in mapinfo)
+ string readsize_msg = strcat("MapReadSizes ", map);
+ float fh = fopen(strcat("maps/", map, ".sizes"), FILE_READ);
+ if(fh >= 0)
+ {
+ map_minplayers = stoi(fgets(fh));
+ map_maxplayers = stoi(fgets(fh));
+ fclose(fh);
+ LOG_TRACEF(readsize_msg, ": ok, min %d max %d", map_minplayers, map_maxplayers);
+ return true;
+ }
+ LOG_TRACE(readsize_msg, ": not found");
+ return false;
+}
+
float MapInfo_FindName(string s)
{
// if there is exactly one map of prefix s, return it