r5514 - trunk/data/qcsrc/client

esteel at icculus.org esteel at icculus.org
Tue Jan 13 16:04:36 EST 2009


Author: esteel
Date: 2009-01-13 16:04:36 -0500 (Tue, 13 Jan 2009)
New Revision: 5514

Modified:
   trunk/data/qcsrc/client/sbar.qc
Log:
changed the teamsize marker to show to all teams except specs, but only show the "press F5" msg to the largest team(s)

Modified: trunk/data/qcsrc/client/sbar.qc
===================================================================
--- trunk/data/qcsrc/client/sbar.qc	2009-01-13 20:38:37 UTC (rev 5513)
+++ trunk/data/qcsrc/client/sbar.qc	2009-01-13 21:04:36 UTC (rev 5514)
@@ -1567,7 +1567,7 @@
 	if(teamplay)
 	{
 		entity tm;
-		float teamsize;
+		float ts_min, ts_max;
 		tm = teams.sort_next;
 		if (tm)
 		{
@@ -1575,20 +1575,21 @@
 			{
 				if(!tm.team_size || tm.team == COLOR_SPECTATOR)
 					continue;
-				if(!teamsize)
-					teamsize = tm.team_size;
-				teamsize = min(teamsize, tm.team_size);
+				if(!ts_min) ts_min = tm.team_size;
+				else ts_min = min(ts_min, tm.team_size);
+				if(!ts_max) ts_max = tm.team_size;
+				else ts_max = max(ts_max, tm.team_size);
 			}
-			if (teamsize)
+			if ((ts_max - ts_min) > 1)
 			{
-				tm = GetTeam(GetPlayerColor(player_localentnum), false);
+				s = strcat(blinkcolor, "Teamnumbers are unbalanced!");
+				tm = GetTeam(myteam, false);
 				if (tm)
 				if (tm.team != COLOR_SPECTATOR)
-				if ((tm.team_size - teamsize) > 1)
-				{
-					s = strcat(blinkcolor, "Teamnumbers are unbalanced! Press ^3", getcommandkey("team menu", "menu_showteamselect"), blinkcolor, " to adjust");
-					o = Sbar_DrawNoteLine(o, s);
-				}
+				if (tm.team_size == ts_max)
+					s = strcat(s, " Press ^3", getcommandkey("team menu", "menu_showteamselect"), blinkcolor, " to adjust");
+
+				o = Sbar_DrawNoteLine(o, s);
 			}
 		}
 	}




More information about the nexuiz-commits mailing list