]> git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/server/intermission.qc
micro-optimization chore: in for-loops change all post-{in,de}crements to pre-{in...
[xonotic/xonotic-data.pk3dir.git] / qcsrc / server / intermission.qc
index f2e9cc53a816f538f23bec35d08e336a99f08cf4..917eb8ce44b18901b3704e7226cf3bfaf99ea1dd 100644 (file)
@@ -154,6 +154,7 @@ void Map_Goto_SetStr(string nextmapname)
 
 void Map_Goto_SetIndex(int position)
 {
+       Map_Current = position;
        cvar_set("g_maplist_index", ftos(position));
        Map_Goto_SetStr(argv(position));
 }
@@ -254,9 +255,8 @@ int MaplistMethod_Shuffle(float exponent) // more clever shuffling
                Map_Count = tokenizebyseparator(autocvar_g_maplist, " ");
 
                // NOTE: the selected map has just been inserted at (insertpos-1)th position
-               Map_Current = insertpos - 1; // this is not really valid, but this way the fallback has a chance of working
-               if(Map_Check(Map_Current, 1))
-                       return Map_Current;
+               if (Map_Check(insertpos - 1, 1))
+                       return insertpos - 1;
        }
        return -1;
 }