Finally fix the animation issue when eating players with very high ping! Seems the...
authorMirceaKitsune <sonichedgehog_hyperblast00@yahoo.com>
Tue, 19 Apr 2011 15:19:02 +0000 (18:19 +0300)
committerMirceaKitsune <sonichedgehog_hyperblast00@yahoo.com>
Tue, 19 Apr 2011 15:19:02 +0000 (18:19 +0300)
data/qcsrc/server/cl_client.qc
data/qcsrc/server/cl_player.qc

index 49d1ea0..2bbc265 100644 (file)
@@ -418,11 +418,12 @@ string CheckPlayerModel(string plyermodel) {
        return plyermodel;\r
 }\r
 \r
-void setmodel_apply(string modelname)\r
+void setmodel_apply(string modelname, float reset_anims)\r
 {\r
        precache_model(modelname);\r
        setmodel(self, modelname); // players have high precision\r
-       player_setupanimsformodel();\r
+       if(reset_anims)\r
+               player_setupanimsformodel();\r
 }\r
 \r
 string setmodel_state()\r
@@ -458,7 +459,7 @@ void Client_setmodel(string applymodel)
        applymodel = CheckPlayerModel(applymodel); // this is never "", so no endless loop\r
        m1 = self.mins;\r
        m2 = self.maxs;\r
-       setmodel_apply(applymodel);\r
+       setmodel_apply(applymodel, FALSE);\r
        setsize (self, m1, m2);\r
 }\r
 \r
@@ -524,7 +525,6 @@ float Client_customizeentityforclient()
                if(self.model != stomachmodel) // don't execute each frame\r
                {\r
                        Client_setmodel(stomachmodel);\r
-                       self.frame = 0; // don't use any animations as a stomach\r
                        self.alpha = other.cvar_cl_vore_stomachmodel;\r
                }\r
                return TRUE;\r
@@ -729,7 +729,7 @@ void FixPlayermodel()
                {\r
                        m1 = self.mins;\r
                        m2 = self.maxs;\r
-                       setmodel_apply (defaultmodel);\r
+                       setmodel_apply (defaultmodel, TRUE);\r
                        setsize (self, m1, m2);\r
                        chmdl = TRUE;\r
                }\r
@@ -742,7 +742,7 @@ void FixPlayermodel()
                        self.playermodel = CheckPlayerModel(self.playermodel); // this is never "", so no endless loop\r
                        m1 = self.mins;\r
                        m2 = self.maxs;\r
-                       setmodel_apply (self.playermodel);\r
+                       setmodel_apply (self.playermodel, TRUE);\r
                        setsize (self, m1, m2);\r
                        chmdl = TRUE;\r
                }\r
index ed94dc4..98f781f 100644 (file)
@@ -219,8 +219,8 @@ float player_getspecies()
 void player_setupanimsformodel()\r
 {\r
        // if this is the stomach model (or any model that can't be animated), don't attempt to animate\r
-       if(substring(self.model, strlen(self.model) - 3, 3) == "md3") // check model extension\r
-               return;\r
+       //if(substring(self.model, strlen(self.model) - 3, 3) == "md3") // check model extension\r
+       //      return;\r
 \r
        local string animfilename;\r
        local float animfile;\r
@@ -293,8 +293,8 @@ void player_setupanimsformodel()
 void player_anim (void)\r
 {\r
        // if this is the stomach model (or any model that can't be animated), don't attempt to animate\r
-       if(substring(self.model, strlen(self.model) - 3, 3) == "md3") // check model extension\r
-               return;\r
+       //if(substring(self.model, strlen(self.model) - 3, 3) == "md3") // check model extension\r
+       //      return;\r
 \r
        updateanim(self);\r
        if (self.weaponentity)\r