]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Replace multiple ifs with && 657/head
authorMorosophos <morosophos@teichisma.info>
Wed, 10 Jul 2019 18:10:35 +0000 (21:10 +0300)
committerMorosophos <morosophos@teichisma.info>
Wed, 10 Jul 2019 18:10:35 +0000 (21:10 +0300)
qcsrc/common/mutators/mutator/vampire/sv_vampire.qc

index 08ced807441710bead6aa80c690f1e9657af697f..12e4bdea43531a6fb1c8cbfc5154257f25fa9687 100644 (file)
@@ -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);
        }
 }