From 0399a9a96c6ee1e789d4d079a2a7410e3092ca8a Mon Sep 17 00:00:00 2001 From: MirceaKitsune Date: Mon, 19 Mar 2012 17:47:39 +0200 Subject: [PATCH] Fix item alpha, and get slow item swallowing to work with dropped consumables --- data/qcsrc/server/t_items.qc | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/data/qcsrc/server/t_items.qc b/data/qcsrc/server/t_items.qc index d7decefe..9b65c50c 100644 --- a/data/qcsrc/server/t_items.qc +++ b/data/qcsrc/server/t_items.qc @@ -366,16 +366,15 @@ void Item_Consumable_Spawn(entity e, entity pl) pl.last_pickup = time; } +float Item_Swallow(entity item, entity player); void Item_DroppedConsumable_Touch() { if(time < self.cnt) return; // 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) + if(Item_Swallow(self, other)) { - Item_Consumable_Spawn(self, other); remove(self); self = world; } @@ -392,6 +391,7 @@ void Item_DroppedConsumable_Spawn(entity e) setmodel(item, e.model); item.health = e.health; item.inithealth = e.inithealth; + item.dmg = e.dmg; item.initdmg = e.initdmg; item.max_health = e.max_health; item.scale = e.scale; @@ -417,7 +417,6 @@ void Item_DroppedConsumable_Spawn(entity e) float Item_Swallow(entity item, entity player) { float pickedup, usage; - pickedup = FALSE; if(item.dmg && cvar("g_vore")) { if(player.stomach_load + item.dmg <= player.stomach_maxload) @@ -567,7 +566,7 @@ void Item_Think() return; self.swallow_progress_prey = max(0, self.swallow_progress_prey - 0.01); - self.alpha = 1 / self.swallow_progress_prey; + self.alpha = 1 - self.swallow_progress_prey; } void Item_Touch (void) -- 2.39.2