]> de.git.xonotic.org Git - voretournament/voretournament.git/blobdiff - data/qcsrc/server/t_items.qc
Don't pickup health items when they no longer offer a health boost. This was removed...
[voretournament/voretournament.git] / data / qcsrc / server / t_items.qc
index 4ec0ed2a59aa423d7e13cc42fa5ead131ebd8e5b..299632a85e68797819e46b1d93031c2cbcb33880 100644 (file)
@@ -256,8 +256,7 @@ void Item_Consumable_Think()
 \r
                        damage_offset = 1;\r
                        if(cvar("g_balance_vore_digestion_distribute")) // apply distributed digestion damage\r
-                               damage_offset *= self.predator.stomach_load / self.predator.stomach_maxload;\r
-                       damage_offset = ceil(damage_offset);\r
+                               damage_offset /= (1 - (self.predator.stomach_load / self.predator.stomach_maxload) * bound(0, cvar("g_balance_vore_digestion_distribute"), 1));\r
                        damage = cvar("g_balance_vore_digestion_damage_item") / damage_offset;\r
 \r
                        self.health -= damage;\r
@@ -361,6 +360,7 @@ void Item_DroppedConsumable_Touch()
 \r
        // give the consumable item to the player touching it\r
        if not(other.stomach_load + self.dmg > other.stomach_maxload || other.stomach_load + self.initdmg > other.stomach_maxload)\r
+       if not(!cvar("g_balance_health_consumable_alwayspickup") && other.health >= self.max_health)\r
        {\r
                Item_Consumable_Spawn(self, other);\r
                remove(self);\r
@@ -481,6 +481,7 @@ float Item_GiveTo(entity item, entity player)
                        if(item.dmg) // consumable item\r
                        {\r
                                if(player.stomach_load + item.dmg <= player.stomach_maxload)\r
+                               if not(!cvar("g_balance_health_consumable_alwayspickup") && player.health >= item.max_health)\r
                                {\r
                                        pickedup = TRUE;\r
                                        Item_Consumable_Spawn(self, player);\r