]> git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/common/mapinfo.qc
Revert "Remove legacy Quake bbox expansion: map entities"
[xonotic/xonotic-data.pk3dir.git] / qcsrc / common / mapinfo.qc
index 0114b252d4b5e51fca39096424c1b3f505e85ec4..82a7e758413de31ffd73eae094b93717c67fb678 100644 (file)
@@ -903,8 +903,10 @@ bool _MapInfo_ParseArena(string arena_filename, int fh, string pFilename, Gamety
                        stored_supportedFeatures |= MAPINFO_FEATURE_WEAPONS;
                        // type in quake 3 holds all the supported gametypes, so we must loop through all of them
                        // TODO: handle support here better to include more Xonotic teamplay modes
-                       string types = strreplace("team", "tdm ft", s);
-                       if(strstrofs(s, "tournament", 0) < 0 && strstrofs(s, "tdm", 0) >= 0) // larger team map, support additional gamemodes!
+                       string types = s;
+                       types = strreplace("team", "tdm ft", types);
+                       types = strreplace("ffa", "dm lms ka", types);
+                       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,
                        {
@@ -933,9 +935,6 @@ bool _MapInfo_ParseArena(string arena_filename, int fh, string pFilename, Gamety
        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 ""
@@ -1342,6 +1341,23 @@ int MapInfo_Get_ByName(string pFilename, float pAllowGenerate, Gametype pGametyp
        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