r5278 - trunk/data/qcsrc/server

DONOTREPLY at icculus.org DONOTREPLY at icculus.org
Sat Dec 20 12:03:33 EST 2008


Author: div0
Date: 2008-12-20 12:03:31 -0500 (Sat, 20 Dec 2008)
New Revision: 5278

Modified:
   trunk/data/qcsrc/server/g_world.qc
Log:
fix maplist shuffling when set to ""


Modified: trunk/data/qcsrc/server/g_world.qc
===================================================================
--- trunk/data/qcsrc/server/g_world.qc	2008-12-19 12:11:48 UTC (rev 5277)
+++ trunk/data/qcsrc/server/g_world.qc	2008-12-20 17:03:31 UTC (rev 5278)
@@ -751,15 +751,14 @@
 
 void Maplist_Init()
 {
-	string temp;
-	temp = cvar_string("g_maplist");
-	Map_Count = tokenizebyseparator(temp, " ");
+	Map_Count = tokenizebyseparator(cvar_string("g_maplist"), " ");
 	if(Map_Count == 0)
 	{
 		bprint( "Maplist is empty!  Resetting it to default map list.\n" );
-		cvar_set("g_maplist", temp = MapInfo_ListAllowedMaps(0, MAPINFO_FLAG_HIDDEN));
+		cvar_set("g_maplist", MapInfo_ListAllowedMaps(0, MAPINFO_FLAG_HIDDEN));
+		ShuffleMaplist();
 		localcmd("\nmenu_cmd sync\n");
-		Map_Count = tokenizebyseparator(temp, " ");
+		Map_Count = tokenizebyseparator(cvar_string("g_maplist"), " ");
 	}
 	if(Map_Count == 0)
 		error("empty maplist, cannot select a new map");
@@ -876,6 +875,7 @@
 			{
 				bprint( "Maplist contains no single playable map!  Resetting it to default map list.\n" );
 				cvar_set("g_maplist", MapInfo_ListAllowedMaps(0, MAPINFO_FLAG_HIDDEN));
+				ShuffleMaplist();
 				localcmd("\nmenu_cmd sync\n");
 			}
 			else
@@ -1896,6 +1896,7 @@
 	{
 		bprint( "Maplist contains no single playable map!  Resetting it to default map list.\n" );
 		cvar_set("g_maplist", MapInfo_ListAllowedMaps(0, MAPINFO_FLAG_HIDDEN));
+		ShuffleMaplist();
 		localcmd("\nmenu_cmd sync\n");
 		for(i = 0; i < 100 && mapvote_count < nmax; ++i)
 			MapVote_AddVotable(GetNextMap(), FALSE);




More information about the nexuiz-commits mailing list