From 0327a004d488178f9c8711a15342fbd362d5d6ba Mon Sep 17 00:00:00 2001 From: =?utf8?q?Amadeusz=20S=C5=82awi=C5=84ski?= Date: Wed, 22 Feb 2017 14:31:21 +0100 Subject: [PATCH] double ifs to single ifs --- qcsrc/common/t_items.qc | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/qcsrc/common/t_items.qc b/qcsrc/common/t_items.qc index d6cae53ef..5585806dd 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); -- 2.39.2