From 4bac06c21d712c323e23d272df697c0a4fde1c71 Mon Sep 17 00:00:00 2001 From: MirceaKitsune Date: Sat, 19 Nov 2011 13:59:11 +0200 Subject: [PATCH] Only pickup an item if there's enough room --- data/qcsrc/server/t_items.qc | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) 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")); } -- 2.39.2