r3601 - in trunk/data: . qcsrc/server

DONOTREPLY at icculus.org DONOTREPLY at icculus.org
Thu May 1 03:35:23 EDT 2008


Author: div0
Date: 2008-05-01 03:35:22 -0400 (Thu, 01 May 2008)
New Revision: 3601

Modified:
   trunk/data/default.cfg
   trunk/data/qcsrc/server/g_world.qc
Log:
g_maplist_check_waypoints: when 1 and the server is not full enough to play bot-less, maps without waypoints will be skipped


Modified: trunk/data/default.cfg
===================================================================
--- trunk/data/default.cfg	2008-04-29 19:36:24 UTC (rev 3600)
+++ trunk/data/default.cfg	2008-05-01 07:35:22 UTC (rev 3601)
@@ -248,6 +248,7 @@
 seta g_maplist_selectrandom 0 // if 1, a random map will be chosen as next map - DEPRECATED in favor of g_maplist_shuffle
 seta g_maplist_shuffle 1 // new randomization method: like selectrandom, but avoid playing the same maps in short succession. This works by taking out the first element and inserting it into g_maplist with a bias to the end of the list.
 // timeout for kill credit when your damage knocks someone into a death trap
+set g_maplist_check_waypoints 0 // when 1, maps are skipped if there currently are bots, but the map has no waypoints
 set g_maxpushtime 8.0
 
 set g_cloaked 0

Modified: trunk/data/qcsrc/server/g_world.qc
===================================================================
--- trunk/data/qcsrc/server/g_world.qc	2008-04-29 19:36:24 UTC (rev 3600)
+++ trunk/data/qcsrc/server/g_world.qc	2008-05-01 07:35:22 UTC (rev 3601)
@@ -342,8 +342,22 @@
 
 float MapHasRightSize(string map)
 {
+	float fh;
+	if(currentbots || cvar("bot_number") || player_count < cvar("minplayers"))
+	if(cvar("g_maplist_check_waypoints"))
+	{
+		dprint("checkwp "); dprint(map);
+		fh = fopen(strcat("maps/", map, ".waypoints"), FILE_READ);
+		if(fh < 0)
+		{
+			dprint(": no waypoints\n");
+			return FALSE;
+		}
+		dprint(": has waypoints\n");
+		fclose(fh);
+	}
+
 	// open map size restriction file
-	float fh;
 	dprint("opensize "); dprint(map);
 	fh = fopen(strcat("maps/", map, ".sizes"), FILE_READ);
 	if(fh >= 0)
@@ -431,7 +445,7 @@
 		return 0;
 	}
 	else
-		dprint( "Couldn't find '", filename, "'..\n" );
+		dprint( "Couldn't select '", filename, "'..\n" );
 
 	return 0;
 }




More information about the nexuiz-commits mailing list