From: Morosophos Date: Wed, 10 Jul 2019 18:10:35 +0000 (+0300) Subject: Replace multiple ifs with && X-Git-Tag: xonotic-v0.8.5~1466^2 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=771f981e95459c4b0e204b6f5e6c3cab28657b92;p=xonotic%2Fxonotic-data.pk3dir.git Replace multiple ifs with && --- diff --git a/qcsrc/common/mutators/mutator/vampire/sv_vampire.qc b/qcsrc/common/mutators/mutator/vampire/sv_vampire.qc index 08ced8074..12e4bdea4 100644 --- a/qcsrc/common/mutators/mutator/vampire/sv_vampire.qc +++ b/qcsrc/common/mutators/mutator/vampire/sv_vampire.qc @@ -14,12 +14,13 @@ MUTATOR_HOOKFUNCTION(vampire, PlayerDamage_SplitHealthArmor) float armor_take = bound(0, M_ARGV(5, float), GetResource(frag_target, RES_ARMOR)); float damage_take = (autocvar_g_vampire_use_total_damage) ? health_take + armor_take : health_take; - if(time >= frag_target.spawnshieldtime) - if(frag_target != frag_attacker) - if(IS_PLAYER(frag_attacker)) - if(!IS_DEAD(frag_target)) + if(time >= frag_target.spawnshieldtime && + frag_target != frag_attacker && + IS_PLAYER(frag_attacker) && + !IS_DEAD(frag_target)) { - GiveResource(frag_attacker, RES_HEALTH, autocvar_g_vampire_factor * damage_take); + GiveResource(frag_attacker, RES_HEALTH, + autocvar_g_vampire_factor * damage_take); } }