X-Git-Url: https://de.git.xonotic.org/?p=xonotic%2Fxonotic-data.pk3dir.git;a=blobdiff_plain;f=qcsrc%2Fserver%2Fg_damage.qc;h=c7336356cae0363a2a8e79a4bd8bff10775c82e8;hp=45962bee7b3e69cb94513c8b57eccb36ba225446;hb=cbf4da25107e5480eedbf4d3d67d103dd448ae83;hpb=6206caf97a69286b25226a8287583e4a4598d19a diff --git a/qcsrc/server/g_damage.qc b/qcsrc/server/g_damage.qc index 45962bee7..c7336356c 100644 --- a/qcsrc/server/g_damage.qc +++ b/qcsrc/server/g_damage.qc @@ -364,11 +364,12 @@ 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; + + if(strstrofs(msg, "%", 0) < 0) + msg = strcat("%s ", msg, " by %s"); Send_KillNotification(a, s, msg, deathtype, MSG_KILL); @@ -435,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) { @@ -847,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; @@ -1165,9 +1154,7 @@ void Fire_ApplyDamage(entity e) if not(Fire_IsBurning(e)) return; - o = e.owner; - while(o.owner) - o = o.owner; + for(t = 0, o = e.owner; o.owner && t < 16; o = o.owner, ++t); if(clienttype(o) == CLIENTTYPE_NOTACLIENT) o = e.fire_owner;