]> git.xonotic.org Git - voretournament/voretournament.git/commitdiff
Fix a bug with items getting stuck when near 0 health, which might have potentially...
authorMirceaKitsune <sonichedgehog_hyperblast00@yahoo.com>
Sat, 19 Nov 2011 16:01:17 +0000 (18:01 +0200)
committerMirceaKitsune <sonichedgehog_hyperblast00@yahoo.com>
Sat, 19 Nov 2011 16:01:17 +0000 (18:01 +0200)
data/qcsrc/server/t_items.qc
data/qcsrc/server/vore.qc

index b43d4f696ae4d758e99b7191008ca105f70e53ce..6aca1abf3ae16da007a657f1b5f1de0883ec840d 100644 (file)
@@ -240,7 +240,7 @@ void Item_Consumable_Think()
 \r
        self.scale = self.health / self.inithealth; // scale matches the item's digestion progress\r
        self.dmg = self.initdmg * self.scale;\r
-       if(self.health < 1)\r
+       if(self.health <= 0)\r
        {\r
                // this item is done\r
                Item_Consumable_Remove(self, FALSE);\r
index 8715660833bc6997016f50461b80f888a179e604..c4bae46f0d2e3618472090fc75862e41eee0657b 100644 (file)
@@ -160,7 +160,7 @@ void Vore_StomachLoad_Apply()
        self.stomach_maxload = cvar("g_balance_vore_load_pred_capacity");\r
        if(cvar("g_healthsize"))\r
                self.stomach_maxload *= self.scale;\r
-       self.stomach_maxload = floor(self.stomach_maxload);\r
+       self.stomach_maxload = ceil(self.stomach_maxload);\r
 \r
        self.stomach_load = 0; // start from zero\r
        FOR_EACH_PLAYER(e)\r
@@ -170,13 +170,13 @@ void Vore_StomachLoad_Apply()
                        prey_mass = cvar("g_balance_vore_load_prey_mass");\r
                        if(cvar("g_healthsize"))\r
                                prey_mass *= e.scale;\r
-                       self.stomach_load += floor(prey_mass);\r
+                       self.stomach_load += ceil(prey_mass);\r
                }\r
        }\r
        for(e = world; (e = find(e, classname, "consumable")); )\r
        {\r
                if(e.predator == self)\r
-                       self.stomach_load += floor(e.dmg);\r
+                       self.stomach_load += ceil(e.dmg);\r
        }\r
 \r
        // apply weight\r