[nexuiz-commits] r7335 - trunk/data/qcsrc/client

DONOTREPLY at icculus.org DONOTREPLY at icculus.org
Tue Aug 4 15:13:48 EDT 2009


Author: div0
Date: 2009-08-04 15:13:48 -0400 (Tue, 04 Aug 2009)
New Revision: 7335

Modified:
   trunk/data/qcsrc/client/Main.qc
   trunk/data/qcsrc/client/sbar.qc
Log:
fix "white team bug"


Modified: trunk/data/qcsrc/client/Main.qc
===================================================================
--- trunk/data/qcsrc/client/Main.qc	2009-08-04 18:52:22 UTC (rev 7334)
+++ trunk/data/qcsrc/client/Main.qc	2009-08-04 19:13:48 UTC (rev 7335)
@@ -176,6 +176,20 @@
 float SetTeam(entity o, float Team)
 {
 	entity tm;
+	switch(Team)
+	{
+		case -1:
+		case COLOR_TEAM1:
+		case COLOR_TEAM2:
+		case COLOR_TEAM3:
+		case COLOR_TEAM4:
+		case COLOR_SPECTATOR:
+			break;
+		default:
+			print("trying to switch to unsupported team ", ftos(Team), "\n");
+			Team = COLOR_SPECTATOR;
+			break;
+	}
 	if(Team == -1) // leave
 	{
 		if(o.has_team)
@@ -610,7 +624,7 @@
 	entity o;
 
 	self.team = ReadByte();
-	o = self.owner = GetTeam(self.team, true);
+	o = self.owner = GetTeam(self.team, true); // these team numbers can always be trusted
 
 #if MAX_TEAMSCORE <= 3
 	for(i = 0; i < MAX_TEAMSCORE; ++i)

Modified: trunk/data/qcsrc/client/sbar.qc
===================================================================
--- trunk/data/qcsrc/client/sbar.qc	2009-08-04 18:52:22 UTC (rev 7334)
+++ trunk/data/qcsrc/client/sbar.qc	2009-08-04 19:13:48 UTC (rev 7335)
@@ -424,7 +424,7 @@
 		"-teams,race,lms/kills -teams,lms/deaths -teams,lms,race/suicides -race,dm,tdm/frags ", // tdm already has this in "score"
 		"+ctf/caps +ctf/pickups +ctf/fckills +ctf/returns ",
 		"+lms/lives +lms/rank ",
-		"+/caps +kh/pushes +kh/destroyed ",
+		"+kh/caps +kh/pushes +kh/destroyed ",
 		"?+race/laps ?+race/time ?+race/fastest ",
 		"+as/objectives +nexball/faults +nexball/goals ",
 		"-lms,race,nexball/score");
@@ -1088,7 +1088,13 @@
 
 		tm = teams.sort_next;
 
-		pos = Sbar_Scoreboard_MakeTable(pos, tm, rgb, bg_size);
+		for(tm = teams.sort_next; tm; tm = tm.sort_next)
+		{
+			if(tm.team == COLOR_SPECTATOR)
+				continue;
+
+			pos = Sbar_Scoreboard_MakeTable(pos, tm, rgb, bg_size);
+		}
 	}
 
 	tmp = pos + '0 1.5 0' * sbar_fontsize_y;



More information about the nexuiz-commits mailing list