]> git.rm.cloudns.org Git - voretournament/voretournament.git/commitdiff
Only pickup an item if there's enough room
authorMirceaKitsune <sonichedgehog_hyperblast00@yahoo.com>
Sat, 19 Nov 2011 11:59:11 +0000 (13:59 +0200)
committerMirceaKitsune <sonichedgehog_hyperblast00@yahoo.com>
Sat, 19 Nov 2011 11:59:11 +0000 (13:59 +0200)
data/qcsrc/server/t_items.qc

index 9ec15cda1fbfc84355842a43e56d0f43822e7e73..5bf6a540911e96b75ff16807424c91ad2b0aad88 100644 (file)
@@ -359,13 +359,18 @@ float Item_GiveTo(entity item, entity player)
                }\r
 \r
                if (item.health)\r
-               if (player.health < item.max_health)\r
                {\r
-                       pickedup = TRUE;\r
                        if(item.dmg) // consumable item\r
-                               Item_Consumable_Spawn(self, player);\r
-                       else\r
                        {\r
+                               if(player.stomach_load + item.dmg <= player.stomach_maxload)\r
+                               {\r
+                                       pickedup = TRUE;\r
+                                       Item_Consumable_Spawn(self, player);\r
+                               }\r
+                       }\r
+                       else if (player.health < item.max_health)\r
+                       {\r
+                               pickedup = TRUE;\r
                                player.health = min(player.health + item.health, item.max_health);\r
                                player.pauserothealth_finished = max(player.pauserothealth_finished, time + cvar("g_balance_pause_health_rot"));\r
                        }\r