]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/server/g_damage.qc
Merge remote branch 'refs/remotes/origin/tzork/turrets'
[xonotic/xonotic-data.pk3dir.git] / qcsrc / server / g_damage.qc
index 5ed980b2306b968d0a17f5226cc80186f1a7474c..76cb7861498c7820ea603c9ad2b118b4f8f48951 100644 (file)
@@ -364,26 +364,14 @@ void Obituary (entity attacker, entity inflictor, entity targ, float deathtype)
 
                                // TODO: fix this?
                                if (deathtype == DEATH_CUSTOM)
-                                       msg = strcat(deathmessage, " by ^1", msg);
-                               else if (deathtype == DEATH_HURTTRIGGER && inflictor.message2 != "")
-                               {
-                                       msg = ftos(strstrofs(inflictor.message2, "#", 0));
-                               }
+                                       msg = deathmessage;
+                               else
+                                       msg = inflictor.message2;
 
-                               float msgtype;
-                               w = DEATH_WEAPONOF(deathtype);
-                               if(w == WEP_LASER && ((cvar("g_balance_laser_secondary_gauntlet") && w & HITTYPE_SECONDARY) || (cvar("g_balance_laser_primary_gauntlet") && !(w & HITTYPE_SECONDARY))))
-                               {
-                                       msgtype = MSG_KILL_MELEE;
-                                       deathtype = KILL_FRAG_GAUNTLET;
-                               }
-                               else if(w == WEP_SHOTGUN && (cvar("g_balance_shotgun_secondary_melee") && w & HITTYPE_SECONDARY))
-                               {
-                                       msgtype = MSG_KILL_MELEE;
-                                       deathtype = KILL_FRAG_SHOTGUN_MELEE;
-                               }
+                               if(strstrofs(msg, "%", 0) < 0)
+                                       msg = strcat("%s ", msg, " by %s");
 
-                               Send_KillNotification(s, a, msg, deathtype, MSG_KILL);
+                               Send_KillNotification(a, s, msg, deathtype, MSG_KILL);
 
                                if(g_ctf && targ.flagcarried)
                                {
@@ -448,6 +436,8 @@ void Obituary (entity attacker, entity inflictor, entity targ, float deathtype)
                                msg = inflictor.message;
                        else if (deathtype == DEATH_CUSTOM)
                                msg = deathmessage;
+                       if(strstrofs(msg, "%", 0) < 0)
+                               msg = strcat("%s ", msg);
 
                        GiveFrags(targ, targ, -1);
                        if(PlayerScore_Add(targ, SP_SCORE, 0) == -5) {
@@ -860,20 +850,6 @@ void Damage (entity targ, entity inflictor, entity attacker, float damage, float
        }
 }
 
-vector NearestPointOnBox(entity box, vector org)
-{
-       vector m1, m2, nearest;
-
-       m1 = box.mins + box.origin;
-       m2 = box.maxs + box.origin;
-
-       nearest_x = bound(m1_x, org_x, m2_x);
-       nearest_y = bound(m1_y, org_y, m2_y);
-       nearest_z = bound(m1_z, org_z, m2_z);
-
-       return nearest;
-}
-
 void Damage_RecordDamage(entity attacker, float deathtype, float damage)
 {
        float weaponid;