r2132 - trunk/data/qcsrc/server

DONOTREPLY at icculus.org DONOTREPLY at icculus.org
Sat Jan 20 16:44:31 EST 2007


Author: div0
Date: 2007-01-20 16:44:30 -0500 (Sat, 20 Jan 2007)
New Revision: 2132

Modified:
   trunk/data/qcsrc/server/g_world.qc
Log:
check argv(g_maplist_index) first, fixes some problems with multiple equal map entries


Modified: trunk/data/qcsrc/server/g_world.qc
===================================================================
--- trunk/data/qcsrc/server/g_world.qc	2007-01-18 18:22:48 UTC (rev 2131)
+++ trunk/data/qcsrc/server/g_world.qc	2007-01-20 21:44:30 UTC (rev 2132)
@@ -455,16 +455,23 @@
 // NOTE: this now expects the map list to be already tokenize()d and the count in Map_Count
 float GetMaplistPosition()
 {
-	float pos;
+	float pos, idx;
 	string map;
 
 	map = GetMapname();
+	idx = cvar("g_maplist_index");
+
+	if(idx >= 0)
+		if(idx < Map_Count)
+			if(map == argv(idx))
+				return idx;
+
 	for(pos = 0; pos < Map_Count; ++pos)
 		if(map == argv(pos))
 			return pos;
 
 	// resume normal maplist rotation if current map is not in g_maplist
-	return cvar("g_maplist_index");
+	return idx;
 }
 
 float MapHasRightSize(string map)




More information about the nexuiz-commits mailing list