From bb130e03b1d57e77c40d0e5c949555c951ee343f Mon Sep 17 00:00:00 2001 From: MirceaKitsune Date: Mon, 30 Jan 2012 23:25:19 +0200 Subject: [PATCH] Don't pickup health items when they no longer offer a health boost. This was removed when consumable items were added. The rule is however cvared, in case there's any use to eat health items after they offer no health boost. --- data/balanceVT.cfg | 1 + data/qcsrc/server/t_items.qc | 2 ++ 2 files changed, 3 insertions(+) diff --git a/data/balanceVT.cfg b/data/balanceVT.cfg index bdcf77a8..c4de2504 100644 --- a/data/balanceVT.cfg +++ b/data/balanceVT.cfg @@ -84,6 +84,7 @@ set g_balance_pause_armor_rot_spawn 5 set g_balance_health_regenstable 25 set g_balance_health_rotstable 150 set g_balance_health_limit 200 +set g_balance_health_consumable_alwayspickup 0 set g_balance_armor_regenstable 100 set g_balance_armor_rotstable 100 set g_balance_armor_limit 100 diff --git a/data/qcsrc/server/t_items.qc b/data/qcsrc/server/t_items.qc index 00205205..299632a8 100644 --- a/data/qcsrc/server/t_items.qc +++ b/data/qcsrc/server/t_items.qc @@ -360,6 +360,7 @@ void Item_DroppedConsumable_Touch() // give the consumable item to the player touching it if not(other.stomach_load + self.dmg > other.stomach_maxload || other.stomach_load + self.initdmg > other.stomach_maxload) + if not(!cvar("g_balance_health_consumable_alwayspickup") && other.health >= self.max_health) { Item_Consumable_Spawn(self, other); remove(self); @@ -480,6 +481,7 @@ float Item_GiveTo(entity item, entity player) if(item.dmg) // consumable item { if(player.stomach_load + item.dmg <= player.stomach_maxload) + if not(!cvar("g_balance_health_consumable_alwayspickup") && player.health >= item.max_health) { pickedup = TRUE; Item_Consumable_Spawn(self, player); -- 2.39.2