From: Amadeusz Sławiński Date: Wed, 22 Feb 2017 13:31:21 +0000 (+0100) Subject: double ifs to single ifs X-Git-Tag: xonotic-v0.8.5~2843^2~8 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=0327a004d488178f9c8711a15342fbd362d5d6ba;p=xonotic%2Fxonotic-data.pk3dir.git double ifs to single ifs --- diff --git a/qcsrc/common/t_items.qc b/qcsrc/common/t_items.qc index d6cae53efc..5585806dde 100644 --- a/qcsrc/common/t_items.qc +++ b/qcsrc/common/t_items.qc @@ -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);