]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Merge branch 'master' into matthiaskrgr/hudsetup
authorMatthias Krüger <matthias.krueger@famsik.de>
Sat, 14 Sep 2013 08:47:05 +0000 (10:47 +0200)
committerMatthias Krüger <matthias.krueger@famsik.de>
Sat, 14 Sep 2013 08:47:05 +0000 (10:47 +0200)
Conflicts:
qcsrc/common/mapinfo.qh

qcsrc/common/mapinfo.qc
qcsrc/common/mapinfo.qh
qcsrc/menu/xonotic/dialog_multiplayer_playersetup_hudconfirm.c
qcsrc/server/g_world.qc

index 16e572615b1ca4899f9a1fbfc13261339c34f267..7949b4c2257e840cd9ee6d1831bf6634f8cda50a 100644 (file)
@@ -992,6 +992,10 @@ float MapInfo_Get_ByName_NoFallbacks(string pFilename, float pAllowGenerate, flo
                {
                        MapInfo_Map_flags |= MAPINFO_FLAG_FRUSTRATING;
                }
+               else if(t == "noautomaplist")
+               {
+                       MapInfo_Map_flags |= MAPINFO_FLAG_NOAUTOMAPLIST;
+               }
                else if(t == "type")
                {
                        t = car(s); s = cdr(s);
index db08fdf07c6a71116099cfa384d325ba19230ac6..c288b008eab8adf8af07cb4fac07241cfadc461a 100644 (file)
@@ -85,6 +85,7 @@ const float MAPINFO_FEATURE_TURRETS       = 4;
 const float MAPINFO_FLAG_HIDDEN           = 1; // not in lsmaps/menu/vcall/etc., can just be changed to manually
 const float MAPINFO_FLAG_FORBIDDEN        = 2; // don't even allow the map by a cvar setting that allows hidden maps
 const float MAPINFO_FLAG_FRUSTRATING      = 4; // this map is near impossible to play, enable at your own risk
+const float MAPINFO_FLAG_NOAUTOMAPLIST    = 8; // do not include when automatically building maplist (counts as hidden for maplist building purposes)
 
 float MapInfo_count;
 
index b06dc9207854e96fd62303ed29961524e900b033..17047b3913662c545f09a75e7255387213422eda 100644 (file)
@@ -13,7 +13,7 @@ ENDCLASS(XonoticHUDConfirmDialog)
 void HUDSetup_Start(entity me, entity btn)
 {
        if not(gamestatus & (GAME_CONNECTED | GAME_ISSERVER))
-               localcmd("map hudsetup/hudsetup", "\n");
+               localcmd("map hudsetup", "\n");
        else
                localcmd("togglemenu 0\n");
                
index d654b91d53f0405ab82f58cf7da6a070a512a9ca..0aa3b342236e4eee9b562ba815a8f6aefd0ea0b3 100644 (file)
@@ -1049,6 +1049,8 @@ float() MaplistMethod_Iterate = // usual method
 {
        float pass, i;
 
+       dprint("Trying MaplistMethod_Iterate\n");
+
        for(pass = 1; pass <= 2; ++pass)
        {
                for(i = 1; i < Map_Count; ++i)
@@ -1064,6 +1066,8 @@ float() MaplistMethod_Iterate = // usual method
 
 float() MaplistMethod_Repeat = // fallback method
 {
+       dprint("Trying MaplistMethod_Repeat\n");
+
        if(Map_Check(Map_Current, 2))
                return Map_Current;
        return -2;
@@ -1073,6 +1077,8 @@ float() MaplistMethod_Random = // random map selection
 {
        float i, imax;
 
+       dprint("Trying MaplistMethod_Random\n");
+
        imax = 42;
 
        for(i = 0; i <= imax; ++i)
@@ -1091,6 +1097,8 @@ float(float exponent) MaplistMethod_Shuffle = // more clever shuffling
 {
        float i, j, imax, insertpos;
 
+       dprint("Trying MaplistMethod_Shuffle\n");
+
        imax = 42;
 
        for(i = 0; i <= imax; ++i)
@@ -1125,10 +1133,14 @@ float(float exponent) MaplistMethod_Shuffle = // more clever shuffling
 void Maplist_Init()
 {
        Map_Count = tokenizebyseparator(autocvar_g_maplist, " ");
-       if(Map_Count == 0)
+       float i;
+       for (i = 0; i < Map_Count; ++i)
+               if (Map_Check(i, 2))
+                       break;
+       if (i == Map_Count)
        {
-               bprint( "Maplist is empty!  Resetting it to default map list.\n" );
-               cvar_set("g_maplist", MapInfo_ListAllAllowedMaps(MapInfo_RequiredFlags(), MapInfo_ForbiddenFlags()));
+               bprint( "Maplist contains no usable maps!  Resetting it to default map list.\n" );
+               cvar_set("g_maplist", MapInfo_ListAllAllowedMaps(MapInfo_RequiredFlags(), MapInfo_ForbiddenFlags() | MAPINFO_FLAG_NOAUTOMAPLIST));
                if(autocvar_g_maplist_shuffle)
                        ShuffleMaplist();
                localcmd("\nmenu_cmd sync\n");
@@ -1231,31 +1243,11 @@ void GotoNextMap(float reinit)
                return;
        alreadychangedlevel = TRUE;
 
-       {
-               string nextMap;
-               float allowReset;
+       string nextMap;
 
-               for(allowReset = 1; allowReset >= 0; --allowReset)
-               {
-                       nextMap = GetNextMap();
-                       if(nextMap != "")
-                               break;
-
-                       if(allowReset)
-                       {
-                               bprint( "Maplist contains no single playable map!  Resetting it to default map list.\n" );
-                               cvar_set("g_maplist", MapInfo_ListAllAllowedMaps(MapInfo_RequiredFlags(), MapInfo_ForbiddenFlags()));
-                               if(autocvar_g_maplist_shuffle)
-                                       ShuffleMaplist();
-                               localcmd("\nmenu_cmd sync\n");
-                       }
-                       else
-                       {
-                               error("Everything is broken - not even the default map list works. Please report this to the developers.");
-                       }
-               }
-               Map_Goto(reinit);
-       }
+       nextMap = GetNextMap();
+       if(nextMap == "")
+               error("Everything is broken - cannot find a next map. Please report this to the developers.");
 }