X-Git-Url: http://de.git.xonotic.org/?p=xonotic%2Fxonotic-data.pk3dir.git;a=blobdiff_plain;f=qcsrc%2Fclient%2Fhud.qc;h=f2a5a34f31fec2574e689fde0e6e6fb1bfd6d2e6;hp=088424eab54984eb045f18bdc1aeb9a6e933c8a6;hb=93a5b591cd2cb527abab50a73fe279fe02efab7e;hpb=b66a5a64ce256767913d7f5d48b540e7e1faca0f diff --git a/qcsrc/client/hud.qc b/qcsrc/client/hud.qc index 088424eab5..f2a5a34f31 100644 --- a/qcsrc/client/hud.qc +++ b/qcsrc/client/hud.qc @@ -1999,9 +1999,12 @@ void HUD_HealthArmor(void) // Notification area (#4) // -string Weapon_SuicideMessage(float id) +string Weapon_SuicideMessage(float deathtype) { - switch (id) + float w; + w = DEATH_WEAPONOF(deathtype); + + switch (w) { case 1: return "lasered himself to hell"; @@ -2010,17 +2013,20 @@ string Weapon_SuicideMessage(float id) case 3: return "did the impossible"; case 4: - if(id & HITTYPE_SECONDARY) + if(deathtype & HITTYPE_SECONDARY) return "tried out his own grenade"; return "detonated"; } // TODO: was blasted by? - return strcat("[no kill message for weapon ", ftos(id), "!]"); + return strcat("[no kill message for weapon ", ftos(w), "!]"); } -string Weapon_KillMessage(float id) +string Weapon_KillMessage(float deathtype) { - switch (id) + float w; + w = DEATH_WEAPONOF(deathtype); + + switch (w) { case 1: return "was lasered to death by"; @@ -2035,7 +2041,7 @@ string Weapon_KillMessage(float id) return "didn't see #'s grenade"; return "almost dodged #'s grenade"; } - return strcat("[no suicide message for weapon ", ftos(id), "!]"); + return strcat("[no suicide message for weapon ", ftos(w), "!]"); } float killnotify_times[10]; @@ -2062,10 +2068,14 @@ void HUD_KillNotify(string s1, string s2, string s3, float type, float msg) if(msg == MSG_SUICIDE) { // TODO: cl_gentle // TODO: way of finding out secondary? - if(type == DEATH_WEAPON) { - HUD_KillNotify_Push(s1, "", stof(s3)); + print("deathtype: ", ftos(type), "\n"); + + float w; + w = DEATH_WEAPONOF(type); + if(WEP_VALID(w)) { + HUD_KillNotify_Push(s1, "", w); if (!HUD_Panel_CheckActive(4) || cvar("hud_notify_print")) - print("^1", s1, "^1 ", Weapon_SuicideMessage(stof(s2)), "\n"); + print("^1", s1, "^1 ", Weapon_SuicideMessage(type), "\n"); } else if (type == DEATH_KILL) print ("^1",s1, "^1 couldn't take it anymore\n"); @@ -2086,7 +2096,16 @@ void HUD_KillNotify(string s1, string s2, string s3, float type, float msg) if (stof(s2) > 2) // killcount > 2 print ("^1",s1,"^1 ended it all after a ",s2," kill spree\n"); } else if(msg == MSG_KILL) { - if(type == KILL_TEAM || type == KILL_TEAM_SPREE) { + print("deathtype: ", ftos(type), "\n"); + + float w; + w = DEATH_WEAPONOF(type); + if(WEP_VALID(w)) { + HUD_KillNotify_Push(s1, s2, w); + if (!HUD_Panel_CheckActive(4) || cvar("hud_notify_print")) + print("^1", s1, "^1 ", Weapon_KillMessage(type), "\n"); + } + else if(type == KILL_TEAM || type == KILL_TEAM_SPREE) { if(cvar("cl_gentle")) { print ("^1", s1, "^1 took action against a team mate\n"); } else { @@ -2107,11 +2126,6 @@ void HUD_KillNotify(string s1, string s2, string s3, float type, float msg) } else if(type == KILL_FIRST_BLOOD) print("^1",s1, "^1 drew first blood", "\n"); - else if (type == DEATH_WEAPON) { - HUD_KillNotify_Push(s1, s2, stof(s3)); - if (!HUD_Panel_CheckActive(4) || cvar("hud_notify_print")) - print("^1", s1, "^1 ", Weapon_KillMessage(stof(s3)), "\n"); - } else if (type == DEATH_TELEFRAG) print ("^1",s1, "^1 was telefragged by ", s2, "\n"); else if (type == DEATH_DROWN)