From dc9e2ff5ce89555a0b660c792138c4187454812e Mon Sep 17 00:00:00 2001 From: terencehill Date: Sat, 12 Nov 2016 21:01:02 +0100 Subject: [PATCH] Fix g_spawnshield_blockdamage not working --- qcsrc/server/player.qc | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/qcsrc/server/player.qc b/qcsrc/server/player.qc index 904447c218..9125b50d7c 100644 --- a/qcsrc/server/player.qc +++ b/qcsrc/server/player.qc @@ -323,6 +323,9 @@ void PlayerDamage(entity this, entity inflictor, entity attacker, float damage, damage /= sqrt(bound(1.0, attacker.cvar_cl_handicap, 100.0)); } + if (time < this.spawnshieldtime && autocvar_g_spawnshield_blockdamage < 1) + damage *= 1 - max(0, autocvar_g_spawnshield_blockdamage); + if(DEATH_ISWEAPON(deathtype, WEP_TUBA)) { // tuba causes blood to come out of the ears @@ -357,7 +360,6 @@ void PlayerDamage(entity this, entity inflictor, entity attacker, float damage, else Violence_GibSplash_At(hitloc, force, 2, bound(0, damage, 200) / 16, this, attacker); - v = healtharmor_applydamage(this.armorvalue, autocvar_g_balance_armor_blockpercent, deathtype, damage); take = v.x; save = v.y; @@ -386,13 +388,6 @@ void PlayerDamage(entity this, entity inflictor, entity attacker, float damage, this.istypefrag = 0; } - if (time < this.spawnshieldtime && autocvar_g_spawnshield_blockdamage < 1) - { - vector v = healtharmor_applydamage(this.armorvalue, max(0, autocvar_g_spawnshield_blockdamage), deathtype, damage); - take = v.x; - save = v.y; - } - MUTATOR_CALLHOOK(PlayerDamage_SplitHealthArmor, inflictor, attacker, this, force, take, save, deathtype, damage); take = bound(0, M_ARGV(4, float), this.health); save = bound(0, M_ARGV(5, float), this.armorvalue); -- 2.39.2