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

DONOTREPLY at icculus.org DONOTREPLY at icculus.org
Sun Nov 8 02:51:26 EST 2009


Author: fruitiex
Date: 2009-11-08 02:51:26 -0500 (Sun, 08 Nov 2009)
New Revision: 8236

Modified:
   trunk/data/qcsrc/client/sbar.qc
Log:
fix team coloring on accuracy panel, add support for minstagib and do small cleanups


Modified: trunk/data/qcsrc/client/sbar.qc
===================================================================
--- trunk/data/qcsrc/client/sbar.qc	2009-11-08 01:28:30 UTC (rev 8235)
+++ trunk/data/qcsrc/client/sbar.qc	2009-11-08 07:51:26 UTC (rev 8236)
@@ -1128,14 +1128,15 @@
 	return 0;
 }
 
+float g_minstagib;
 float average_accuracy;
 vector Sbar_DrawScoreboardAccuracyStats(vector pos, vector rgb, vector bg_size)
 {
-	float i, count_hitscan, count_splash, row;  // count is the number of 'colums'
+	float i;
 	float weapon_hit, weapon_damage, weapon_stats;
 	float fontsize = 40 * 1/3;
 	float weapon_cnt = 12;
-	float rows ;
+	float rows;
 	if(cvar("sbar_accuracy_doublerows"))
 		rows = 2;
 	else
@@ -1180,9 +1181,13 @@
 	weapons_with_stats = 0;
 	if(rows == 2)
 		pos_x += sbwidth/weapon_cnt / 2;
+
+	if(getstati(STAT_SWITCHWEAPON) == WEP_MINSTANEX)
+		g_minstagib = 1; // TODO: real detection for minstagib?
+
 	for(i = WEP_FIRST; i <= WEP_LAST; ++i)
 	{
-		if (i == 10 || i == 11 || i == 14 || i == 16) // skip port-o-launch, minstanex, tuba and fireball
+		if ((i == WEP_NEX && g_minstagib) || i == WEP_PORTO || (i == WEP_MINSTANEX && !g_minstagib) || i == WEP_TUBA || i == WEP_FIREBALL) // skip port-o-launch, nex || minstanex, tuba and fireball
 			continue;
 		weapon_hit = weapon_hits[i];
 		weapon_damage = weapon_fired[i];
@@ -1343,10 +1348,13 @@
 			pos_y += 1.25 * sbar_fontsize_y;
 		}
 	}
-	else if(cvar("sbar_accuracy"))
-		pos = Sbar_DrawScoreboardAccuracyStats(pos, rgb, bg_size);
+	else if(cvar("sbar_accuracy")) {
+		if(teamplay)
+			pos = Sbar_DrawScoreboardAccuracyStats(pos, GetTeamRGB(myteam), bg_size);
+		else
+			pos = Sbar_DrawScoreboardAccuracyStats(pos, rgb, bg_size);
+	}
 
-
 	tmp = pos + '0 1.5 0' * sbar_fontsize_y;
 	pos_y += 3 * sbar_fontsize_y;
 



More information about the nexuiz-commits mailing list