X-Git-Url: https://git.xonotic.org/?a=blobdiff_plain;f=qcsrc%2Fserver%2Fdamage.qc;h=969423bfb83f8b0e55ae1e6add6f25b5bdebefcc;hb=812dd3215ba88d7bcd2b38b9c4acd19d84a5152b;hp=560f3e49024f284e92367382ce8eede138bae9eb;hpb=0ce97ac6e23a4bfa907cd5a25990b4abe90656cf;p=xonotic%2Fxonotic-data.pk3dir.git diff --git a/qcsrc/server/damage.qc b/qcsrc/server/damage.qc index 560f3e490..969423bfb 100644 --- a/qcsrc/server/damage.qc +++ b/qcsrc/server/damage.qc @@ -17,6 +17,7 @@ #include #include #include +#include #include #include #include @@ -31,7 +32,6 @@ #include #include #include -#include #include #include #include @@ -609,9 +609,12 @@ void Damage(entity targ, entity inflictor, entity attacker, float damage, int de // These are ALWAYS lethal // No damage modification here // Instead, prepare the victim for his death... - SetResourceExplicit(targ, RES_ARMOR, 0); + if(deathtype == DEATH_TEAMCHANGE.m_id || deathtype == DEATH_AUTOTEAMCHANGE.m_id) + { + SetResourceExplicit(targ, RES_ARMOR, 0); + SetResourceExplicit(targ, RES_HEALTH, 0.9); // this is < 1 + } StatusEffects_remove(STATUSEFFECT_SpawnShield, targ, STATUSEFFECT_REMOVE_CLEAR); - SetResourceExplicit(targ, RES_HEALTH, 0.9); // this is < 1 targ.flags -= targ.flags & FL_GODMODE; damage = 100000; } @@ -787,7 +790,7 @@ void Damage(entity targ, entity inflictor, entity attacker, float damage, int de if(PHYS_INPUT_BUTTON_CHAT(victim)) attacker.typehitsound += 1; else - attacker.damage_dealt += damage; + attacker.hitsound_damage_dealt += damage; } impressive_hits += 1; @@ -1194,12 +1197,12 @@ void Fire_ApplyDamage(entity e) t = min(frametime, fireendtime - time); d = e.fire_damagepersec * t; - hi = e.fire_owner.damage_dealt; + hi = e.fire_owner.hitsound_damage_dealt; ty = e.fire_owner.typehitsound; Damage(e, e, e.fire_owner, d, e.fire_deathtype, DMG_NOWEP, e.origin, '0 0 0'); if(e.fire_hitsound && e.fire_owner) { - e.fire_owner.damage_dealt = hi; + e.fire_owner.hitsound_damage_dealt = hi; e.fire_owner.typehitsound = ty; } e.fire_hitsound = true;