From f8d86f7d12adcc9c189b5239b6f9a7867763b85c Mon Sep 17 00:00:00 2001 From: MirceaKitsune Date: Sat, 19 Nov 2011 17:11:59 +0200 Subject: [PATCH] Fix a bug with picking partly consumed items back up --- data/qcsrc/server/t_items.qc | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/data/qcsrc/server/t_items.qc b/data/qcsrc/server/t_items.qc index 092b287d..6d9dfadf 100644 --- a/data/qcsrc/server/t_items.qc +++ b/data/qcsrc/server/t_items.qc @@ -315,9 +315,17 @@ void Item_Consumable_Spawn(entity e, entity pl) item.solid = SOLID_NOT; setmodel(item, e.model); item.health = e.health; - item.inithealth = e.health; + if(e.inithealth) + { + item.inithealth = e.inithealth; + item.initdmg = e.initdmg; + } + else + { + item.inithealth = e.health; + item.initdmg = e.dmg; + } item.max_health = e.max_health; - item.initdmg = e.dmg; item.predator = pl; item.aiment = pl; @@ -366,8 +374,8 @@ void Item_DroppedConsumable_Spawn(entity e) setmodel(item, e.model); item.health = e.health; item.inithealth = e.inithealth; - item.max_health = e.max_health; item.initdmg = e.initdmg; + item.max_health = e.max_health; item.scale = e.scale; item.colormod = e.colormod; -- 2.39.2