From: MirceaKitsune Date: Sat, 19 Nov 2011 16:01:17 +0000 (+0200) Subject: Fix a bug with items getting stuck when near 0 health, which might have potentially... X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=9e0401d8c22f9b5520d92f53ca504961b9fb8b81;p=voretournament%2Fvoretournament.git Fix a bug with items getting stuck when near 0 health, which might have potentially affected players too --- diff --git a/data/qcsrc/server/t_items.qc b/data/qcsrc/server/t_items.qc index b43d4f69..6aca1abf 100644 --- a/data/qcsrc/server/t_items.qc +++ b/data/qcsrc/server/t_items.qc @@ -240,7 +240,7 @@ void Item_Consumable_Think() self.scale = self.health / self.inithealth; // scale matches the item's digestion progress self.dmg = self.initdmg * self.scale; - if(self.health < 1) + if(self.health <= 0) { // this item is done Item_Consumable_Remove(self, FALSE); diff --git a/data/qcsrc/server/vore.qc b/data/qcsrc/server/vore.qc index 87156608..c4bae46f 100644 --- a/data/qcsrc/server/vore.qc +++ b/data/qcsrc/server/vore.qc @@ -160,7 +160,7 @@ void Vore_StomachLoad_Apply() self.stomach_maxload = cvar("g_balance_vore_load_pred_capacity"); if(cvar("g_healthsize")) self.stomach_maxload *= self.scale; - self.stomach_maxload = floor(self.stomach_maxload); + self.stomach_maxload = ceil(self.stomach_maxload); self.stomach_load = 0; // start from zero FOR_EACH_PLAYER(e) @@ -170,13 +170,13 @@ void Vore_StomachLoad_Apply() prey_mass = cvar("g_balance_vore_load_prey_mass"); if(cvar("g_healthsize")) prey_mass *= e.scale; - self.stomach_load += floor(prey_mass); + self.stomach_load += ceil(prey_mass); } } for(e = world; (e = find(e, classname, "consumable")); ) { if(e.predator == self) - self.stomach_load += floor(e.dmg); + self.stomach_load += ceil(e.dmg); } // apply weight