Fix stomach states not being applied correctly when swallowing more than 3 players
authorMirceaKitsune <sonichedgehog_hyperblast00@yahoo.com>
Thu, 7 Jul 2011 12:11:26 +0000 (15:11 +0300)
committerMirceaKitsune <sonichedgehog_hyperblast00@yahoo.com>
Thu, 7 Jul 2011 12:11:26 +0000 (15:11 +0300)
data/qcsrc/server/cl_client.qc

index ec685f3..edb5886 100644 (file)
@@ -435,8 +435,16 @@ string setmodel_state()
        newmodel_name = substring(self.playermodel, 0, strlen(self.playermodel) - 4);\r
        newmodel_extension = substring(self.playermodel, strlen(self.playermodel) - 4, 4);\r
 \r
-       if(self.stomach_load)\r
-               applymodel = strcat(newmodel_name, "_state", ftos(floor(self.stomach_load)), newmodel_extension);\r
+       float vore_state;\r
+       if(self.stomach_load > ceil(cvar("g_balance_vore_swallow_limit") * 0.666666666666))\r
+               vore_state = 3;\r
+       else if(self.stomach_load > ceil(cvar("g_balance_vore_swallow_limit") * 0.333333333333))\r
+               vore_state = 2;\r
+       else if(self.stomach_load)\r
+               vore_state = 1;\r
+\r
+       if(vore_state)\r
+               applymodel = strcat(newmodel_name, "_state", ftos(vore_state), newmodel_extension);\r
        else\r
                applymodel = self.playermodel;\r
 \r