From: MirceaKitsune Date: Sat, 19 Nov 2011 11:59:11 +0000 (+0200) Subject: Only pickup an item if there's enough room X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=4bac06c21d712c323e23d272df697c0a4fde1c71;p=voretournament%2Fvoretournament.git Only pickup an item if there's enough room --- diff --git a/data/qcsrc/server/t_items.qc b/data/qcsrc/server/t_items.qc index 9ec15cda..5bf6a540 100644 --- a/data/qcsrc/server/t_items.qc +++ b/data/qcsrc/server/t_items.qc @@ -359,13 +359,18 @@ float Item_GiveTo(entity item, entity player) } if (item.health) - if (player.health < item.max_health) { - pickedup = TRUE; if(item.dmg) // consumable item - Item_Consumable_Spawn(self, player); - else { + if(player.stomach_load + item.dmg <= player.stomach_maxload) + { + pickedup = TRUE; + Item_Consumable_Spawn(self, player); + } + } + else if (player.health < item.max_health) + { + pickedup = TRUE; player.health = min(player.health + item.health, item.max_health); player.pauserothealth_finished = max(player.pauserothealth_finished, time + cvar("g_balance_pause_health_rot")); }