]> git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/common/mapinfo.qc
Merge remote-tracking branch 'origin/master' into samual/combined_updates
[xonotic/xonotic-data.pk3dir.git] / qcsrc / common / mapinfo.qc
index 322c7ba5190e7e520367a337cdf779d5bfdf2edf..8af5b49fcf47c6219acf48c12db54a1c4f87e6c4 100644 (file)
@@ -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";
@@ -565,6 +564,15 @@ string _MapInfo_GetDefaultEx(float t)
        return "";
 }
 
+float _MapInfo_GetTeamPlayBool(float t)
+{
+       entity e;
+       for(e = MapInfo_Type_first; e; e = e.enemy)
+               if(t == e.items)
+                       return e.team;
+       return FALSE;
+}
+
 void _MapInfo_Map_ApplyGametypeEx(string s, float pWantedType, float pThisType)
 {
        string sa, k, v;
@@ -603,14 +611,11 @@ void _MapInfo_Map_ApplyGametypeEx(string s, float pWantedType, float pThisType)
                p = strstrofs(sa, "=", 0);
                if(p < 0)
                {
-                       k = "timelimit";
-                       v = s;
-               }
-               else
-               {
-                       k = substring(sa, 0, p);
-                       v = substring(sa, p+1, -1);
+                       print("Invalid gametype setting in mapinfo for gametype ", MapInfo_Type_ToString(pWantedType), ": ", sa, "\n");
+                       continue;
                }
+               k = substring(sa, 0, p);
+               v = substring(sa, p+1, -1);
 
                if(k == "timelimit")
                {
@@ -646,7 +651,7 @@ void _MapInfo_Map_ApplyGametypeEx(string s, float pWantedType, float pThisType)
                }
                else
                {
-                       print("Invalid gametype key in mapinfo: ", k, "\n");
+                       print("Invalid gametype setting in mapinfo for gametype ", MapInfo_Type_ToString(pWantedType), ": ", sa, "\n");
                }
        }
 
@@ -683,6 +688,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)