From: terencehill Date: Sat, 12 Nov 2016 20:01:02 +0000 (+0100) Subject: Fix g_spawnshield_blockdamage not working X-Git-Tag: xonotic-v0.8.2~444 X-Git-Url: http://de.git.xonotic.org/?p=xonotic%2Fxonotic-data.pk3dir.git;a=commitdiff_plain;h=dc9e2ff5ce89555a0b660c792138c4187454812e Fix g_spawnshield_blockdamage not working --- 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);