]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
don't perform any more traces if we are already playing the correct jump animation...
authorFruitieX <fruitiex@gmail.com>
Thu, 26 May 2011 09:56:37 +0000 (12:56 +0300)
committerFruitieX <fruitiex@gmail.com>
Thu, 26 May 2011 09:56:37 +0000 (12:56 +0300)
qcsrc/server/cl_player.qc
qcsrc/server/t_jumppads.qc

index 8819ba765bf31c1f0167a9508ea4b77de1cd206b..d19584163f5681343c698772ed798d47ef75d999 100644 (file)
@@ -259,7 +259,7 @@ void player_anim (void)
        {
                if (!(self.flags & FL_ONGROUND))
                {
-                       if (self.crouch)
+                       if (self.crouch && self.animstate_startframe != 5) // don't perform another trace if already playing the crouch jump anim
                        {
                                traceline(self.origin + '0 0 1' * PL_CROUCH_MIN_z, self.origin + '0 0 1' * (PL_CROUCH_MIN_z - autocvar_sv_player_jumpanim_minfall), TRUE, self);
                                if(!trace_startsolid && trace_fraction == 1 || self.animstate_startframe == 7) // don't get stuck on idle animation in midair
@@ -268,7 +268,7 @@ void player_anim (void)
                                        self.restart_jump = FALSE;
                                }
                        }
-                       else
+                       else if (self.animstate_startframe != 8) // 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 == 7) // don't get stuck on idle animation in midair
index 1e72b765a0a0b548de052f9d31accdfc8e906b0c..b07f04d5723255580b7881977fd3ae4bd7e80dd3 100644 (file)
@@ -192,6 +192,17 @@ void trigger_push_touch()
                        }
                        else
                                other.lastteleporttime = time;
+
+                       if (other.crouch)
+                       {
+                               setanim(other, other.anim_duckjump, FALSE, TRUE, other.restart_jump);
+                               other.restart_jump = FALSE;
+                       }
+                       else
+                       {
+                               setanim(other, other.anim_jump, FALSE, TRUE, other.restart_jump);
+                               other.restart_jump = FALSE;
+                       }
                }
                else
                        other.jumppadcount = TRUE;