]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
No need to calculate the acc. color if it's not displayed anyway... (in the HUD weapo...
authorterencehill <piuntn@gmail.com>
Tue, 2 Nov 2010 23:26:31 +0000 (00:26 +0100)
committerterencehill <piuntn@gmail.com>
Tue, 2 Nov 2010 23:26:31 +0000 (00:26 +0100)
qcsrc/client/hud.qc

index f7c9c9fd054f6da0c96664b744835aa1e0ffb335..43658f31b200b8c5634835e0a43de104e9ee05f6 100644 (file)
@@ -1726,22 +1726,21 @@ void HUD_Weapons(void)
                        {
                                weapon_hit = weapon_hits[self.weapon-WEP_FIRST];
                                weapon_stats = floor(100 * weapon_hit / weapon_damage);
-                       }
 
-                       // find the max level lower than weapon_stats
-                       float j;
-                       j = acc_levels-1;
-                       while ( j && weapon_stats < acc_lev[j] )
-                               --j;
+                               // find the max level lower than weapon_stats
+                               float j;
+                               j = acc_levels-1;
+                               while ( j && weapon_stats < acc_lev[j] )
+                                       --j;
 
-                       // inject color j+1 in color j, how much depending on how much weapon_stats is higher than level j
-                       float factor;
-                       factor = (weapon_stats - acc_lev[j]) / (acc_lev[j+1] - acc_lev[j]);
-                       color = acc_col[j];
-                       color = color + factor * (acc_col[j+1] - color);
+                               // inject color j+1 in color j, how much depending on how much weapon_stats is higher than level j
+                               float factor;
+                               factor = (weapon_stats - acc_lev[j]) / (acc_lev[j+1] - acc_lev[j]);
+                               color = acc_col[j];
+                               color = color + factor * (acc_col[j+1] - color);
 
-                       if(weapon_damage)
                                drawpic_aspect_skin(wpnpos, "weapon_accuracy", wpnsize, color, panel_fg_alpha, DRAWFLAG_NORMAL);
+                       }
                }
 
                // draw the weapon icon