don't get stuck on melee anim on some occasions
authorFruitieX <fruitiex@gmail.com>
Thu, 9 Jun 2011 12:45:11 +0000 (15:45 +0300)
committerFruitieX <fruitiex@gmail.com>
Thu, 9 Jun 2011 12:45:11 +0000 (15:45 +0300)
qcsrc/server/cl_physics.qc
qcsrc/server/cl_player.qc

index d2203c241877754ca5b59e021b0ada1957dc3240..7f43fe66ef9dc2a9d9d17d30106a27791817fdb8 100644 (file)
@@ -163,7 +163,7 @@ void PlayerJump (void)
 
        if (self.crouch)
                setanim(self, self.anim_duckjump, FALSE, TRUE, TRUE);
-       else if (self.animstate_startframe != self.anim_melee_x) // jump animation shouldn't override melee until we have animation blending
+       else if (self.animstate_startframe != self.anim_melee_x || (self.animstate_startframe == self.anim_melee_x && time - self.animstate_starttime >= 21/20)) // jump animation shouldn't override melee until we have animation blending (or until the anim finished, 21/20 = numframes/fps)
                setanim(self, self.anim_jump, FALSE, TRUE, TRUE);
 
        if(g_jump_grunt)
index a9333a18875284f10f18725b0d8feb1c87b0f349..57732e6be3c884a35ba00bdb2b9090caa068d15a 100644 (file)
@@ -284,7 +284,7 @@ void player_anim (void)
                                        if (self.animstate_startframe != self.anim_jump_x) // don't perform another trace if already playing the jump anim
                                        {
                                                traceline(self.origin + '0 0 1' * PL_MIN_z, self.origin + '0 0 1' * (PL_MIN_z - autocvar_sv_player_jumpanim_minfall), TRUE, self);
-                                               if(!trace_startsolid && trace_fraction == 1 || self.animstate_startframe == self.anim_idle_x) // don't get stuck on idle animation in midair
+                                               if(!trace_startsolid && trace_fraction == 1 || self.animstate_startframe == self.anim_idle_x || (self.animstate_startframe == self.anim_melee_x && time - self.animstate_starttime >= 21/20)) // don't get stuck on idle animation in midair, nor melee after it finished
                                                {
                                                        setanim(self, self.anim_jump, FALSE, TRUE, self.restart_jump);
                                                        self.restart_jump = FALSE;
@@ -323,7 +323,6 @@ void player_anim (void)
                }
                else
                        setanim(self, self.anim_idle, TRUE, FALSE, FALSE);
-               print(ftos(time), " ", ftos(self.animstate_startframe), "\n");
        }
 
        if (self.weaponentity)