r4100 - trunk/data/qcsrc/server

DONOTREPLY at icculus.org DONOTREPLY at icculus.org
Sun Aug 10 13:49:50 EDT 2008


Author: div0
Date: 2008-08-10 13:49:50 -0400 (Sun, 10 Aug 2008)
New Revision: 4100

Modified:
   trunk/data/qcsrc/server/cl_client.qc
   trunk/data/qcsrc/server/g_world.qc
   trunk/data/qcsrc/server/race.qc
   trunk/data/qcsrc/server/race.qh
   trunk/data/qcsrc/server/scores.qc
   trunk/data/qcsrc/server/scores.qh
Log:
new improvements (winning condition, zero is worst handling)


Modified: trunk/data/qcsrc/server/cl_client.qc
===================================================================
--- trunk/data/qcsrc/server/cl_client.qc	2008-08-10 16:51:37 UTC (rev 4099)
+++ trunk/data/qcsrc/server/cl_client.qc	2008-08-10 17:49:50 UTC (rev 4100)
@@ -65,10 +65,12 @@
 				{
 					if(ent.race_checkpoint != race_PreviousCheckpoint(self.race_checkpoint))
 						return -1;
-					if(race_place_valid && (spot.race_place != self.race_place))
+					float pl;
+					pl = self.race_place;
+					if(pl > race_highest_place_spawn)
+						pl = 0;
+					if(spot.race_place != pl)
 						return -1;
-					if(!race_place_valid && (spot.race_place != 0))
-						return -1;
 				}
 				good = 1;
 			}

Modified: trunk/data/qcsrc/server/g_world.qc
===================================================================
--- trunk/data/qcsrc/server/g_world.qc	2008-08-10 16:51:37 UTC (rev 4099)
+++ trunk/data/qcsrc/server/g_world.qc	2008-08-10 17:49:50 UTC (rev 4100)
@@ -1494,7 +1494,7 @@
 		limit = -limit;
 	}
 	
-	return GetWinningCode(limit && (WinningConditionHelper_topscore >= limit), WinningConditionHelper_equality);
+	return GetWinningCode(limit && WinningConditionHelper_topscore && (WinningConditionHelper_topscore >= limit), WinningConditionHelper_equality);
 }
 
 float WinningCondition_RanOutOfSpawns()

Modified: trunk/data/qcsrc/server/race.qc
===================================================================
--- trunk/data/qcsrc/server/race.qc	2008-08-10 16:51:37 UTC (rev 4099)
+++ trunk/data/qcsrc/server/race.qc	2008-08-10 17:49:50 UTC (rev 4100)
@@ -423,8 +423,5 @@
 		ScoreRules_race();
 	}
 
-	if(PlayerScore_Sort(race_place) <= race_highest_place_spawn)
-		race_place_valid = 1;
-	else
-		race_place_valid = 0;
+	PlayerScore_Sort(race_place);
 }

Modified: trunk/data/qcsrc/server/race.qh
===================================================================
--- trunk/data/qcsrc/server/race.qh	2008-08-10 16:51:37 UTC (rev 4099)
+++ trunk/data/qcsrc/server/race.qh	2008-08-10 17:49:50 UTC (rev 4100)
@@ -6,6 +6,6 @@
 float race_spawns;
 float race_PreviousCheckpoint(float f);
 float race_NextCheckpoint(float f);
-float race_place_valid;
+float race_highest_place_spawn;
 float race_fraglimit;
 .float race_place;

Modified: trunk/data/qcsrc/server/scores.qc
===================================================================
--- trunk/data/qcsrc/server/scores.qc	2008-08-10 16:51:37 UTC (rev 4099)
+++ trunk/data/qcsrc/server/scores.qc	2008-08-10 17:49:50 UTC (rev 4100)
@@ -328,14 +328,7 @@
 
 		WinningConditionHelper_topscore = teamscorekeepers[WinningConditionHelper_winnerteam].teamscores_primary;
 		WinningConditionHelper_lowerisbetter = (teamscores_flags_primary & SFL_LOWER_IS_BETTER);
-		if(teamscores_flags_primary & SFL_ZERO_IS_WORST)
-			if(WinningConditionHelper_topscore == 0)
-			{
-				if(WinningConditionHelper_lowerisbetter)
-					WinningConditionHelper_topscore = 999999999;
-				else
-					WinningConditionHelper_topscore = -999999999;
-			}
+		WinningConditionHelper_zeroisworst = (teamscores_flags_primary & SFL_ZERO_IS_WORST);
 		if(teamscores_flags_primary & SFL_TIME)
 			WinningConditionHelper_topscore /= 10;
 

Modified: trunk/data/qcsrc/server/scores.qh
===================================================================
--- trunk/data/qcsrc/server/scores.qh	2008-08-10 16:51:37 UTC (rev 4099)
+++ trunk/data/qcsrc/server/scores.qh	2008-08-10 17:49:50 UTC (rev 4100)
@@ -91,6 +91,8 @@
 float WinningConditionHelper_winnerteam; ///< the color of the winning team, or -1 if none
 entity WinningConditionHelper_winner;    ///< the winning player, or world if none
 float WinningConditionHelper_lowerisbetter; ///< lower is better, duh
+float WinningConditionHelper_zeroisworst;   ///< zero is worst, duh
+#define WINNINGCONDITIONHELPER_LOWERISBETTER_WORST 999999999
 
 /**
  * Returns score strings for eventlog etc.




More information about the nexuiz-commits mailing list