From: MirceaKitsune Date: Mon, 19 Mar 2012 15:47:39 +0000 (+0200) Subject: Fix item alpha, and get slow item swallowing to work with dropped consumables X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=0399a9a96c6ee1e789d4d079a2a7410e3092ca8a;p=voretournament%2Fvoretournament.git Fix item alpha, and get slow item swallowing to work with dropped consumables --- 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)