From: Samual Lenks Date: Sun, 16 Dec 2012 03:30:48 +0000 (-0500) Subject: Slightly more simplification/cleanup X-Git-Tag: xonotic-v0.7.0~62^2~23^2~325 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=f5db6fb1286a574689cc1da3037c116160f47bb2;p=xonotic%2Fxonotic-data.pk3dir.git Slightly more simplification/cleanup --- diff --git a/qcsrc/server/g_damage.qc b/qcsrc/server/g_damage.qc index 70e037bcb..ccc3e8144 100644 --- a/qcsrc/server/g_damage.qc +++ b/qcsrc/server/g_damage.qc @@ -349,8 +349,9 @@ void Obituary_SpecialDeath(entity notif_target, float murder, float deathtype, s } } } + float w_deathtype; -void Obituary_WeaponDeath(float murder, float deathtype, string s1, string s2) +float Obituary_WeaponDeath(float murder, float deathtype, string s1, string s2) { float death_weapon = DEATH_WEAPONOF(deathtype); @@ -362,11 +363,13 @@ void Obituary_WeaponDeath(float murder, float deathtype, string s1, string s2) if(death_message) { Send_Notification(world, MSG_ALL, MSG_WEAPON, death_message, s1, s2, NO_FL_ARG, NO_FL_ARG, NO_FL_ARG); } else { dprint(sprintf("Obituary_WeaponDeath(): ^1Deathtype ^7(%s-%d)^1 has no notification for weapon %d!\n", Deathtype_Name(deathtype), deathtype, death_weapon)); } + + return TRUE; } + return FALSE; } .float FRAG_VERBOSE; - void Obituary(entity attacker, entity inflictor, entity targ, float deathtype) { // Sanity check @@ -419,11 +422,7 @@ void Obituary(entity attacker, entity inflictor, entity targ, float deathtype) } Obituary_SpecialDeath(targ, FALSE, deathtype, s1, s2, f1, f2, NO_FL_ARG); } - else if(DEATH_WEAPONOF(deathtype)) - { - Obituary_WeaponDeath(FALSE, deathtype, targ.netname, NO_STR_ARG); - } - else + else if not(Obituary_WeaponDeath(FALSE, deathtype, targ.netname, NO_STR_ARG)) { backtrace("SUICIDE: what the hell happened here?\n"); } @@ -530,8 +529,8 @@ void Obituary(entity attacker, entity inflictor, entity targ, float deathtype) } } - if(DEATH_WEAPONOF(deathtype)) { Obituary_WeaponDeath(TRUE, deathtype, targ.netname, attacker.netname); } - else { Obituary_SpecialDeath(targ, TRUE, deathtype, s2, s1, targ.killcount, NO_FL_ARG, NO_FL_ARG); } + if not(Obituary_WeaponDeath(TRUE, deathtype, targ.netname, attacker.netname)) + Obituary_SpecialDeath(targ, TRUE, deathtype, s2, s1, targ.killcount, NO_FL_ARG, NO_FL_ARG); } }