]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/common/mapinfo.qc
Merge branch 'master' of git://nl.git.xonotic.org/xonotic/xonotic-data.pk3dir
[xonotic/xonotic-data.pk3dir.git] / qcsrc / common / mapinfo.qc
index 78c3b750d83b6008357bfe942108d5c5b34cdd96..8493887cae715ca1413e51cdd94cc087ec694d2f 100644 (file)
@@ -84,7 +84,7 @@ float MapInfo_Cache_Retrieve(string map)
 
 // GLOB HANDLING (for all BSP files)
 float _MapInfo_globopen;
-float _MapInfo_globcount; 
+float _MapInfo_globcount;
 float _MapInfo_globhandle;
 string _MapInfo_GlobItem(float i)
 {
@@ -164,7 +164,7 @@ float MapInfo_FilterGametype(float pGametype, float pFeatures, float pFlagsRequi
        }
        MapInfo_count = j + 1;
        MapInfo_ClearTemps();
-       
+
        // sometimes the glob isn't sorted nicely, so fix it here...
        heapsort(MapInfo_count, _MapInfo_FilterList_swap, _MapInfo_FilterList_cmp, world);
 
@@ -313,6 +313,8 @@ float _MapInfo_Generate(string pFilename) // 0: failure, 1: ok ent, 2: ok bsp
                                        MapInfo_Map_supportedGametypes |= MAPINFO_TYPE_CTF;
                                else if(v == "team_CTF_blueflag")
                                        MapInfo_Map_supportedGametypes |= MAPINFO_TYPE_CTF;
+                               else if(v == "invasion_spawnpoint")
+                                       MapInfo_Map_supportedGametypes |= MAPINFO_TYPE_INVASION;
                                else if(v == "target_assault_roundend")
                                        MapInfo_Map_supportedGametypes |= MAPINFO_TYPE_ASSAULT;
                                else if(v == "onslaught_generator")
@@ -370,8 +372,6 @@ float _MapInfo_Generate(string pFilename) // 0: failure, 1: ok ent, 2: ok bsp
                        MapInfo_Map_supportedGametypes |= MAPINFO_TYPE_FREEZETAG;
                        MapInfo_Map_supportedGametypes |= MAPINFO_TYPE_CA;
                }
-               if(                     diameter < 4096)
-                       MapInfo_Map_supportedGametypes |= MAPINFO_TYPE_ARENA;
                if(spawnpoints >= 12 && diameter > 5120)
                        MapInfo_Map_supportedGametypes |= MAPINFO_TYPE_KEYHUNT;
        }
@@ -416,7 +416,6 @@ string _MapInfo_GetDefault(float t)
                case MAPINFO_TYPE_DOMINATION:      return "200 20 0";
                case MAPINFO_TYPE_CTF:             return "300 20 10 0";
                case MAPINFO_TYPE_LMS:             return "9 20 0";
-               case MAPINFO_TYPE_ARENA:           return "10 20 0";
                case MAPINFO_TYPE_CA:              return "10 20 0";
                case MAPINFO_TYPE_KEYHUNT:         return "1000 20 3 0";
                case MAPINFO_TYPE_ASSAULT:         return "20 0";
@@ -442,7 +441,7 @@ void _MapInfo_Map_ApplyGametype(string s, float pWantedType, float pThisType, fl
 
        if(load_default)
                _MapInfo_Map_ApplyGametype(_MapInfo_GetDefault(pThisType), pWantedType, pThisType, FALSE);
-       
+
        if(pWantedType == MAPINFO_TYPE_ASSAULT || pWantedType == MAPINFO_TYPE_ONSLAUGHT || pWantedType == MAPINFO_TYPE_RACE || pWantedType == MAPINFO_TYPE_CTS) // these modes don't use fraglimit
        {
                cvar_set("fraglimit", "0");
@@ -509,7 +508,7 @@ void _MapInfo_Map_ApplyGametype(string s, float pWantedType, float pThisType, fl
                s = cdr(s);
        }
        */
-       
+
        // rc = timelimit timelimit_qualification laps laps_teamplay
        if(pWantedType == MAPINFO_TYPE_RACE)
        {
@@ -683,6 +682,12 @@ float MapInfo_Type_FromString(string t)
                t = "ka";
                print("'. Should use '", t, "'.\n");
        }
+       if(t == "invasion")
+       {
+               print("MapInfo_Type_FromString (probably ", MapInfo_Map_bspname, "): using deprecated name '", t);
+               t = "inv";
+               print("'. Should use '", t, "'.\n");
+       }
        if(t == "all")
                return MAPINFO_TYPE_ALL;
        for(e = MapInfo_Type_first; e; e = e.enemy)
@@ -694,7 +699,7 @@ float MapInfo_Type_FromString(string t)
 string MapInfo_Type_ToString(float t)
 {
        entity e;
-       if(t == MAPINFO_TYPE_ALL)     
+       if(t == MAPINFO_TYPE_ALL)
                return "all";
        for(e = MapInfo_Type_first; e; e = e.enemy)
                if(t == e.items)
@@ -735,12 +740,12 @@ void _MapInfo_Parse_Settemp(string pFilename, string acl, float type, string s,
        o = strstrofs(s, "\"", 0);
        if(o >= 0)
                s = substring(s, 0, o);
-       
+
        //   remove // comments
        o = strstrofs(s, "//", 0);
        if(o >= 0)
                s = substring(s, 0, o);
-       
+
        //   remove trailing spaces
        while(substring(s, -1, 1) == " ")
                s = substring(s, 0, -2);
@@ -1251,7 +1256,7 @@ void MapInfo_LoadMap(string s, float reinit)
        //      print("EMERGENCY: can't play the selected map in the given game mode. Falling back to DM.\n");
        //      MapInfo_SwitchGameType(MAPINFO_TYPE_DEATHMATCH);
        //}
-       
+
        cvar_settemp_restore();
        if(reinit)
                localcmd(strcat("\nmap ", s, "\n"));