fix nasty bug that could happen with the notify panel in the first few seconds of...
authorFruitieX <rasse@rasse-lappy.localdomain>
Sat, 3 Jul 2010 22:03:48 +0000 (01:03 +0300)
committerFruitieX <rasse@rasse-lappy.localdomain>
Sat, 3 Jul 2010 22:03:48 +0000 (01:03 +0300)
qcsrc/client/hud.qc

index a666571bd1cfd5bcef01f0bea2a45d38883aa551..d521475e07e5a46026dded5fcd9cf71e202e2e23 100644 (file)
@@ -2797,6 +2797,7 @@ void HUD_Notify (void)
        float i, j;
        for(j = 0; j < entries; ++j)
        {
+               s = "";
                if(autocvar_hud_notify_flip)
                        i = j;
                else // rather nasty hack for ordering items from the bottom up
@@ -2925,8 +2926,11 @@ void HUD_Notify (void)
                                        color = '0 0 1';
                                }
                        }
-                       drawpic_aspect_skin(weap_pos, s, '2 1 0' * height, color, panel_fg_alpha * a, DRAWFLAG_NORMAL);
-                       drawcolorcodedstring(pos_attacker, attacker, fontsize, panel_fg_alpha * a, DRAWFLAG_NORMAL);
+                       if(s != "" && a)
+                       {
+                               drawpic_aspect_skin(weap_pos, s, '2 1 0' * height, color, panel_fg_alpha * a, DRAWFLAG_NORMAL);
+                               drawcolorcodedstring(pos_attacker, attacker, fontsize, panel_fg_alpha * a, DRAWFLAG_NORMAL);
+                       }
                }
                // X [did action to] Y
                else
@@ -2998,9 +3002,12 @@ void HUD_Notify (void)
                                s = "notify_void";
                                color = '1 1 1';
                        }
-                       drawpic_aspect_skin(weap_pos, s, '2 1 0' * height, color, panel_fg_alpha * a, DRAWFLAG_NORMAL);
-                       drawcolorcodedstring(pos_attacker, attacker, fontsize, panel_fg_alpha * a, DRAWFLAG_NORMAL);
-                       drawcolorcodedstring(pos_victim, victim, fontsize, panel_fg_alpha * a, DRAWFLAG_NORMAL);
+                       if(s != "" && a)
+                       {
+                               drawpic_aspect_skin(weap_pos, s, '2 1 0' * height, color, panel_fg_alpha * a, DRAWFLAG_NORMAL);
+                               drawcolorcodedstring(pos_attacker, attacker, fontsize, panel_fg_alpha * a, DRAWFLAG_NORMAL);
+                               drawcolorcodedstring(pos_victim, victim, fontsize, panel_fg_alpha * a, DRAWFLAG_NORMAL);
+                       }
                }
        }
 }