]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/common/mapinfo.qc
Apply a patch by Melanosuchus, fixing issues noted in http://dev.xonotic.org/issues...
[xonotic/xonotic-data.pk3dir.git] / qcsrc / common / mapinfo.qc
index b8fe58b34481a868bb7883e773d887183af876d7..3d06854578acbda85607a119a59bea958e9c4d4d 100644 (file)
@@ -696,6 +696,15 @@ float MapInfo_Type_FromString(string t)
        return 0;
 }
 
        return 0;
 }
 
+string MapInfo_Type_Description(float t)
+{
+       entity e;
+       for(e = MapInfo_Type_first; e; e = e.enemy)
+               if(t == e.items)
+                       return e.gametype_description;
+       return "";
+}
+
 string MapInfo_Type_ToString(float t)
 {
        entity e;
 string MapInfo_Type_ToString(float t)
 {
        entity e;
@@ -1136,7 +1145,8 @@ float MapInfo_Get_ByName(string pFilename, float pAllowGenerate, float pGametype
        {
                if(!(MapInfo_Map_supportedGametypes & pGametypeToSet))
                {
        {
                if(!(MapInfo_Map_supportedGametypes & pGametypeToSet))
                {
-                       error("Can't select the requested game type. This should never happen as the caller should prevent it!\n");
+                       //error("Can't select the requested game type. This should never happen as the caller should prevent it!\n");
+                       return 0;
                        //_MapInfo_Map_ApplyGametypeEx("", pGametypeToSet, MAPINFO_TYPE_DEATHMATCH);
                        //return;
                }
                        //_MapInfo_Map_ApplyGametypeEx("", pGametypeToSet, MAPINFO_TYPE_DEATHMATCH);
                        //return;
                }
@@ -1265,14 +1275,14 @@ void MapInfo_LoadMap(string s, float reinit)
                localcmd(strcat("\nchangelevel ", s, "\n"));
 }
 
                localcmd(strcat("\nchangelevel ", s, "\n"));
 }
 
-string MapInfo_ListAllowedMaps(float pRequiredFlags, float pForbiddenFlags)
+string MapInfo_ListAllowedMaps(float type, float pRequiredFlags, float pForbiddenFlags)
 {
        string out;
        float i;
 
        // to make absolutely sure:
        MapInfo_Enumerate();
 {
        string out;
        float i;
 
        // to make absolutely sure:
        MapInfo_Enumerate();
-       MapInfo_FilterGametype(MapInfo_CurrentGametype(), MapInfo_CurrentFeatures(), pRequiredFlags, pForbiddenFlags, 0);
+       MapInfo_FilterGametype(type, MapInfo_CurrentFeatures(), pRequiredFlags, pForbiddenFlags, 0);
 
        out = "";
        for(i = 0; i < MapInfo_count; ++i)
 
        out = "";
        for(i = 0; i < MapInfo_count; ++i)