]> git.xonotic.org Git - voretournament/voretournament.git/blobdiff - data/qcsrc/server/cl_player.qc
Make sure that only the animation info of the normal player model is used, with a...
[voretournament/voretournament.git] / data / qcsrc / server / cl_player.qc
index 3997e3ded0b8a479529b23a8160af1cff9454ffb..e282ed37e836a32238750c3469e776cd4bc29306 100644 (file)
@@ -218,6 +218,10 @@ float player_getspecies()
 \r
 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
+\r
        local string animfilename;\r
        local float animfile;\r
        // defaults for legacy .zym models without animinfo files\r
@@ -245,7 +249,7 @@ void player_setupanimsformodel()
        self.anim_backright = '21 1 1';\r
        self.anim_backleft  = '22 1 1';\r
        animparseerror = FALSE;\r
-       animfilename = strcat(self.model, ".animinfo");\r
+       animfilename = strcat(self.playermodel, ".animinfo"); // only the normal player model may contain animation info\r
        animfile = fopen(animfilename, FILE_READ);\r
        if (animfile >= 0)\r
        {\r
@@ -281,13 +285,16 @@ void player_setupanimsformodel()
        }\r
        else\r
                dprint("File ", animfilename, " not found, assuming legacy .zym model animation timings\n");\r
+\r
+       // reset animstate now\r
+       setanim(self, self.anim_idle, TRUE, FALSE, TRUE);\r
 };\r
 \r
 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