r2636 - trunk/data/qcsrc/server

DONOTREPLY at icculus.org DONOTREPLY at icculus.org
Sun May 20 16:43:46 EDT 2007


Author: div0
Date: 2007-05-20 16:43:45 -0400 (Sun, 20 May 2007)
New Revision: 2636

Modified:
   trunk/data/qcsrc/server/g_world.qc
Log:
move map voting to CheckRules_World, let's see if it breaks or not


Modified: trunk/data/qcsrc/server/g_world.qc
===================================================================
--- trunk/data/qcsrc/server/g_world.qc	2007-05-20 19:48:07 UTC (rev 2635)
+++ trunk/data/qcsrc/server/g_world.qc	2007-05-20 20:43:45 UTC (rev 2636)
@@ -736,6 +736,7 @@
 ============
 */
 .float autoscreenshot;
+void() MapVote_Start;
 void() MapVote_Think;
 float mapvote_initialized;
 void() IntermissionThink =
@@ -759,8 +760,7 @@
 		if (time < intermission_exittime + 10 && !self.button0 && !self.button2 && !self.button3 && !self.button6 && !self.buttonuse)
 			return;
 
-	if(intermission_exittime >= 0)
-		MapVote_Think();
+	MapVote_Start();
 };
 
 /*
@@ -937,7 +937,7 @@
 	if(player_count > 0)
 		intermission_exittime = time + cvar("sv_mapchange_delay");
 	else
-		intermission_exittime = -60;
+		intermission_exittime = -1;
 
 	WriteByte (MSG_ALL, SVC_CDTRACK);
 	WriteByte (MSG_ALL, 3);
@@ -1432,9 +1432,12 @@
 	local float fraglimit;
 
 	VoteThink();
+	MapVote_Think();
 
 	SetDefaultAlpha();
 
+	/*
+	MapVote_Think should now do that part
 	if (intermission_running)
 		if (time >= intermission_exittime + 60)
 		{
@@ -1442,6 +1445,7 @@
 				GotoNextMap();
 			return;
 		}
+	*/
 
 	if (gameover)	// someone else quit the game already
 		return;
@@ -1558,6 +1562,7 @@
 float mapvote_maxlen;
 float mapvote_voters;
 float mapvote_votes[MAPVOTE_COUNT];
+float mapvote_run;
 .float mapvote;
 
 void MapVote_ClearAllVotes()
@@ -1835,8 +1840,15 @@
 		centerprint_atprio(other, CENTERPRIO_MAPVOTE, msgstr);
 	}
 }
+void MapVote_Start()
+{
+	mapvote_run = TRUE;
+}
 void MapVote_Think()
 {
+	if(!mapvote_run)
+		return;
+
 	if(alreadychangedlevel)
 		return;
 
@@ -1854,7 +1866,7 @@
 			alreadychangedlevel = TRUE;
 			return;
 		}
-		if(!cvar("g_maplist_votable"))
+		if(!cvar("g_maplist_votable") || player_count <= 0)
 		{
 			GotoNextMap();
 			return;




More information about the nexuiz-commits mailing list