]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Fix a few warnings when g_maplist is empty
authorMario <mario@smbclan.net>
Fri, 2 Aug 2019 08:56:46 +0000 (18:56 +1000)
committerMario <mario@smbclan.net>
Fri, 2 Aug 2019 08:56:46 +0000 (18:56 +1000)
qcsrc/server/g_world.qc

index 07027875ee6c340f5c8e4106ec52f48b7c04e768..5b34926fcc1214b7af2e6c3f6e88582cf1fda9e0 100644 (file)
@@ -1202,11 +1202,17 @@ float MaplistMethod_Shuffle(float exponent) // more clever shuffling
 
 void Maplist_Init()
 {
-       Map_Count = tokenizebyseparator(autocvar_g_maplist, " ");
-       float i;
-       for (i = 0; i < Map_Count; ++i)
-               if (Map_Check(i, 2))
-                       break;
+       float i = Map_Count = 0;
+       if(autocvar_g_maplist != "")
+       {
+               Map_Count = tokenizebyseparator(autocvar_g_maplist, " ");
+               for (i = 0; i < Map_Count; ++i)
+               {
+                       if (Map_Check(i, 2))
+                               break;
+               }
+       }
+       
        if (i == Map_Count)
        {
                bprint( "Maplist contains no usable maps!  Resetting it to default map list.\n" );