]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/common/mapinfo.qc
Merge remote branch 'refs/remotes/origin/terencehill/misc_bugfixes'
[xonotic/xonotic-data.pk3dir.git] / qcsrc / common / mapinfo.qc
index 9bb7fa2bbaef56f8a13163cf196d49d5674bdb2c..10b594320434f2d0bae15925d23063ac0537fcd1 100644 (file)
@@ -426,11 +426,15 @@ void _MapInfo_Map_ApplyGametype(string s, float pWantedType, float pThisType, fl
        }
        else
        {
-               cvar_set("fraglimit", car(s));
+               sa = car(s);
+               if(sa != "")
+                       cvar_set("fraglimit", sa);
                s = cdr(s);
        }
 
-       cvar_set("timelimit", car(s));
+       sa = car(s);
+       if(sa != "")
+               cvar_set("timelimit", sa);
        s = cdr(s);
 
        if(pWantedType == MAPINFO_TYPE_TEAM_DEATHMATCH)
@@ -481,15 +485,27 @@ void _MapInfo_Map_ApplyGametype(string s, float pWantedType, float pThisType, fl
        if(pWantedType == MAPINFO_TYPE_CTS)
        {
                sa = car(s);
-               if(sa != "")
-                       cvar_set("fraglimit", sa);
+
+               // this is the skill of the map
+               // not parsed by anything yet
+               // for map databases
+               //if(sa != "")
+               //      cvar_set("fraglimit", sa);
+
                s = cdr(s);
        }
 
-       sa = car(s);
-       if(sa != "")
-               cvar_set("leadlimit", sa);
-       s = cdr(s);
+       if(pWantedType == MAPINFO_TYPE_ASSAULT || pWantedType == MAPINFO_TYPE_ONSLAUGHT || pWantedType == MAPINFO_TYPE_CTS) // these modes don't use fraglimit
+       {
+               cvar_set("leadlimit", "0");
+       }
+       else
+       {
+               sa = car(s);
+               if(sa != "")
+                       cvar_set("leadlimit", sa);
+               s = cdr(s);
+       }
 }
 
 float MapInfo_Type_FromString(string t)
@@ -704,7 +720,7 @@ float MapInfo_Get_ByName(string pFilename, float pAllowGenerate, float pGametype
 
                for(i = 1; i <= MapInfo_Map_supportedGametypes; i *= 2)
                        if(MapInfo_Map_supportedGametypes & i)
-                               fputs(fh, sprintf("type %s %s\n", i, MapInfo_GetDefault(i)));
+                               fputs(fh, sprintf("type %s %s\n", MapInfo_Type_ToString(i), MapInfo_GetDefault(i)));
 
                fh2 = fopen(strcat("scripts/", pFilename, ".arena"), FILE_READ);
                if(fh2 >= 0)