r2026 - branches/nexuiz-2.0/data/qcsrc/server

DONOTREPLY at icculus.org DONOTREPLY at icculus.org
Sat Dec 9 08:37:51 EST 2006


Author: div0
Date: 2006-12-09 08:37:51 -0500 (Sat, 09 Dec 2006)
New Revision: 2026

Modified:
   branches/nexuiz-2.0/data/qcsrc/server/g_world.qc
Log:
really prevent same map from coming again


Modified: branches/nexuiz-2.0/data/qcsrc/server/g_world.qc
===================================================================
--- branches/nexuiz-2.0/data/qcsrc/server/g_world.qc	2006-12-09 12:55:26 UTC (rev 2025)
+++ branches/nexuiz-2.0/data/qcsrc/server/g_world.qc	2006-12-09 13:37:51 UTC (rev 2026)
@@ -393,6 +393,7 @@
 }
 
 float Map_Count, Map_Current;
+string Map_Current_Name;
 
 // NOTE: this now expects the map list to be already tokenize()d and the count in Map_Count
 float GetMaplistPosition()
@@ -447,12 +448,10 @@
 float(float position, float pass) Map_Check =
 {
 	string filename;
-	string map_current;
 	string map_next;
 	map_next = argv(position);
-	map_current = GetMapname();
 	if(pass <= 1)
-		if(map_next == map_current) // same map again in first pass?
+		if(map_next == Map_Current_Name) // same map again in first pass?
 			return 0;
 	filename = Map_Filename(position);
 	if(TryFile(filename))
@@ -571,6 +570,10 @@
 	if(Map_Count == 0)
 		error("empty maplist, cannot select a new map");
 	Map_Current = bound(0, GetMaplistPosition(), Map_Count - 1);
+
+	Map_Current_Name = strzone(argv(Map_Current)); // will be automatically freed on exit thanks to DP
+	// this may or may not be correct, but who cares, in the worst case a map
+	// isn't chosen in the first pass that should have been
 }
 
 void() GotoNextMap =




More information about the nexuiz-commits mailing list