]> de.git.xonotic.org Git - voretournament/voretournament.git/commitdiff
Actually fix the last bug. Amazing what trouble the smallest piece of code can be -.-
authorMirceaKitsune <sonichedgehog_hyperblast00@yahoo.com>
Sat, 19 Nov 2011 17:53:31 +0000 (19:53 +0200)
committerMirceaKitsune <sonichedgehog_hyperblast00@yahoo.com>
Sat, 19 Nov 2011 17:53:31 +0000 (19:53 +0200)
data/qcsrc/server/vore.qc

index c690955f10aa4cc2365d5cb347e3078529a2c2fe..d89de475e64e9c9f2ab690d20b05de3fcd918a7f 100644 (file)
@@ -170,7 +170,7 @@ void Vore_StomachLoad_Apply()
                return;\r
 \r
        entity e;\r
-       float prey_mass;\r
+       float prey_mass, final_load;\r
 \r
        // apply the stomach capacity of the predator\r
        self.stomach_maxload = cvar("g_balance_vore_load_pred_capacity");\r
@@ -178,28 +178,28 @@ void Vore_StomachLoad_Apply()
                self.stomach_maxload *= self.scale;\r
        self.stomach_maxload = ceil(self.stomach_maxload);\r
 \r
-       self.stomach_load = 0; // start from zero\r
        FOR_EACH_PLAYER(e)\r
        {\r
                if(e.predator == self)\r
                {\r
+                       if(self.cvar_cl_vore_autodigest > 1)\r
+                               Vore_AutoDigest(self);\r
                        prey_mass = cvar("g_balance_vore_load_prey_mass");\r
                        if(cvar("g_healthsize"))\r
                                prey_mass *= e.scale;\r
-                       self.stomach_load += ceil(prey_mass);\r
-                       if(self.cvar_cl_vore_autodigest > 1)\r
-                               Vore_AutoDigest(self);\r
+                       final_load += ceil(prey_mass);\r
                }\r
        }\r
        for(e = world; (e = find(e, classname, "consumable")); )\r
        {\r
                if(e.predator == self)\r
                {\r
-                       self.stomach_load += ceil(e.dmg);\r
                        if(self.cvar_cl_vore_autodigest > 0)\r
                                Vore_AutoDigest(self);\r
+                       final_load += ceil(e.dmg);\r
                }\r
        }\r
+       self.stomach_load = final_load;\r
 \r
        // apply weight\r
        self.gravity = 1 + (self.stomach_load / self.stomach_maxload) * cvar("g_balance_vore_load_pred_weight");\r