X-Git-Url: http://de.git.xonotic.org/?a=blobdiff_plain;f=qcsrc%2Fserver%2Fg_damage.qc;h=6f8c9490ef907175c088a5c51315dcaef1ce8f38;hb=3dbc0b5b9ab0f255ec91b8670aeb7cd62218f873;hp=3b4386b57d368ea56859a13ac6a1b82d7e01b776;hpb=506ed08693c047ac9526fc73c85dc5c73110d44f;p=xonotic%2Fxonotic-data.pk3dir.git diff --git a/qcsrc/server/g_damage.qc b/qcsrc/server/g_damage.qc index 3b4386b57..6f8c9490e 100644 --- a/qcsrc/server/g_damage.qc +++ b/qcsrc/server/g_damage.qc @@ -278,7 +278,7 @@ void Send_CSQC_Centerprint(entity e, string s1, string s2, float msg, float type void Obituary (entity attacker, entity inflictor, entity targ, float deathtype) { string s, a, msg; - float p, w, type; + float w, type; if (targ.classname == "player" || targ.classname == "corpse") { @@ -342,7 +342,6 @@ void Obituary (entity attacker, entity inflictor, entity targ, float deathtype) } else { - string blood_message, victim_message; if (!checkrules_firstblood) { checkrules_firstblood = TRUE; @@ -363,13 +362,15 @@ void Obituary (entity attacker, entity inflictor, entity targ, float deathtype) attacker.taunt_soundtime = time + 1; // 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)); - } - Send_KillNotification(s, a, msg, deathtype, MSG_KILL); + if (deathtype == DEATH_CUSTOM) + 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); if(g_ctf && targ.flagcarried) { @@ -389,10 +390,7 @@ void Obituary (entity attacker, entity inflictor, entity targ, float deathtype) if (attacker.killcount > 2) { Send_KillNotification(a, ftos(attacker.killcount), "", KILL_SPREE, MSG_SPREE); } - - LogDeath("frag", deathtype, attacker, targ); - - if (attacker.killcount == 3) + else if (attacker.killcount == 3) { Send_KillNotification(a, "", "", KILL_SPREE_3, MSG_SPREE); AnnounceTo(attacker, "03kills"); @@ -427,6 +425,7 @@ void Obituary (entity attacker, entity inflictor, entity targ, float deathtype) Send_KillNotification(a, "", "", KILL_SPREE_30, MSG_SPREE); AnnounceTo(attacker, "30kills"); } + LogDeath("frag", deathtype, attacker, targ); } } else @@ -436,6 +435,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) { @@ -463,6 +464,7 @@ void Obituary (entity attacker, entity inflictor, entity targ, float deathtype) entity damage_targ; entity damage_inflictor; entity damage_attacker; +.float prevhitsound; void Damage (entity targ, entity inflictor, entity attacker, float damage, float deathtype, vector hitloc, vector force) { @@ -725,10 +727,14 @@ void Damage (entity targ, entity inflictor, entity attacker, float damage, float { if(damage > 0) { - if(targ.BUTTON_CHAT) - attacker.typehitsound += 1; - else - attacker.hitsound += 1; + if(attacker.weapon != WEP_ELECTRO && attacker.weapon != WEP_LASER || ((attacker.weapon == WEP_ELECTRO && cvar("g_balance_electro_lightning") || attacker.weapon == WEP_LASER) && attacker.prevhitsound + cvar("sv_hitsound_antispam_time") < time)) + { + if(targ.BUTTON_CHAT) + attacker.typehitsound += 1; + else + attacker.hitsound += 1; + attacker.prevhitsound = time; + } damage_goodhits += 1; damage_gooddamage += damage; @@ -746,6 +752,8 @@ void Damage (entity targ, entity inflictor, entity attacker, float damage, float if(deathtype & HITTYPE_HEADSHOT) headshot = 1; } + if(g_ca) + PlayerScore_Add(attacker, SP_SCORE, damage * cvar("g_ca_damage2score_multiplier")); } } else @@ -843,20 +851,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; @@ -1161,9 +1155,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;