]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
double ifs to single ifs
authorAmadeusz Sławiński <amade@asmblr.net>
Wed, 22 Feb 2017 13:31:21 +0000 (14:31 +0100)
committerAmadeusz Sławiński <amade@asmblr.net>
Wed, 22 Feb 2017 13:31:21 +0000 (14:31 +0100)
qcsrc/common/t_items.qc

index d6cae53efcb1457bba295ca2973c99ddb5009725..5585806ddeeb1a66b6d24407925e6531f2b6c3f9 100644 (file)
@@ -1047,16 +1047,17 @@ float healtharmor_pickupevalfunc(entity player, entity item)
 
        float itemarmor = item.armorvalue;
        float itemhealth = item.health;
+
        if(item.item_group)
        {
                itemarmor *= min(4, item.item_group_count);
                itemhealth *= min(4, item.item_group_count);
        }
-       if (itemarmor)
-       if (player.armorvalue < item.max_armorvalue)
+
+       if (itemarmor && (player.armorvalue < item.max_armorvalue))
                c = itemarmor / max(1, player.armorvalue * 2/3 + player.health * 1/3);
-       if (itemhealth)
-       if (player.health < item.max_health)
+
+       if (itemhealth && (player.health < item.max_health))
                c = itemhealth / max(1, player.health);
 
        rating *= min(2, c);