]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/client/hud.qc
oh now that i read the commit message these breaks actually make sense, nice one :-P
[xonotic/xonotic-data.pk3dir.git] / qcsrc / client / hud.qc
index 2ca312c54129dbf016c5655599603f5c022e0861..f77f1c1c1af2b1009147f2f7a27978126c2fc580 100644 (file)
@@ -2622,7 +2622,7 @@ void HUD_KillNotify_Push(string attacker, string victim, float actiontype, float
        --kn_index;
        if (kn_index == -1)
                kn_index = KN_MAX_ENTRIES-1;
-       killnotify_times[kn_index] = time; // -1 indicates the message is deleted
+       killnotify_times[kn_index] = time;
        killnotify_deathtype[kn_index] = wpn;
        killnotify_actiontype[kn_index] = actiontype;
        if(killnotify_attackers[kn_index])
@@ -2688,7 +2688,11 @@ void HUD_KillNotify(string s1, string s2, string s3, float type, float msg) // s
        } else if(msg == MSG_KILL) {
                w = DEATH_WEAPONOF(type);
                if(WEP_VALID(w)) {
-                       HUD_KillNotify_Push(s1, s2, 1, type);
+                       if((w == WEP_CAMPINGRIFLE || w == WEP_MINSTANEX) && type & HITTYPE_HEADSHOT) // all headshot weapons go here
+                               HUD_KillNotify_Push(s1, s2, 1, DEATH_HEADSHOT);
+                       else
+                               HUD_KillNotify_Push(s1, s2, 1, type);
+
                        if (alsoprint)
                                print("^1", sprintf(Weapon_KillMessage(type), strcat(s2, "^1"), strcat(s1, "^1")), "\n"); // default order: victim, killer
                }
@@ -3144,9 +3148,6 @@ void HUD_Notify (void)
                if (j == KN_MAX_ENTRIES)
                        j = 0;
 
-               if (killnotify_times[j] == -1)
-                       break;
-
                if(killnotify_times[j] + when > time)
                        a = 1;
                else if(fadetime)
@@ -3154,13 +3155,11 @@ void HUD_Notify (void)
                        a = bound(0, (killnotify_times[j] + when + fadetime - time) / fadetime, 1);
                        if(!a)
                        {
-                               killnotify_times[j] = -1;
                                break;
                        }
                }
                else
                {
-                       killnotify_times[j] = -1;
                        break;
                }
 
@@ -3328,6 +3327,10 @@ void HUD_Notify (void)
                        {
                                s = "notify_void";
                        }
+                       else if(killnotify_deathtype[j] == DEATH_HEADSHOT)
+                       {
+                               s = "notify_headshot";
+                       }
                        else if(killnotify_deathtype[j] == RACE_SERVER_RECORD)
                        {
                                s = "race_newrecordserver";
@@ -3961,11 +3964,17 @@ void HUD_VoteWindow(void)
        }
 
        // draw the progress bars
-       drawsetcliparea(pos_x, pos_y, mySize_x * 0.5 * (vote_yescount/vote_needed), mySize_y);
-       drawpic_skin(pos + eY * (5/8) * mySize_y, "voteprogress_prog", eX * mySize_x + eY * (3/8) * mySize_y, '1 1 1', a, DRAWFLAG_NORMAL);
+       if(vote_yescount && vote_needed)
+       {
+               drawsetcliparea(pos_x, pos_y, mySize_x * 0.5 * (vote_yescount/vote_needed), mySize_y);
+               drawpic_skin(pos + eY * (5/8) * mySize_y, "voteprogress_prog", eX * mySize_x + eY * (3/8) * mySize_y, '1 1 1', a, DRAWFLAG_NORMAL);
+       }
 
-       drawsetcliparea(pos_x + mySize_x - mySize_x * 0.5 * (vote_nocount/vote_needed), pos_y, mySize_x * 0.5, mySize_y);
-       drawpic_skin(pos + eY * (5/8) * mySize_y, "voteprogress_prog", eX * mySize_x + eY * (3/8) * mySize_y, '1 1 1', a, DRAWFLAG_NORMAL);
+       if(vote_nocount && vote_needed)
+       {
+               drawsetcliparea(pos_x + mySize_x - mySize_x * 0.5 * (vote_nocount/vote_needed), pos_y, mySize_x * 0.5, mySize_y);
+               drawpic_skin(pos + eY * (5/8) * mySize_y, "voteprogress_prog", eX * mySize_x + eY * (3/8) * mySize_y, '1 1 1', a, DRAWFLAG_NORMAL);
+       }
 
        drawresetcliparea();