From 8e3024de97a4561ac97f825bf3c90429c2c8447d Mon Sep 17 00:00:00 2001 From: FruitieX Date: Thu, 26 May 2011 12:56:37 +0300 Subject: [PATCH] don't perform any more traces if we are already playing the correct jump animation. Jumppads set jump anim in their touch() --- qcsrc/server/cl_player.qc | 4 ++-- qcsrc/server/t_jumppads.qc | 11 +++++++++++ 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/qcsrc/server/cl_player.qc b/qcsrc/server/cl_player.qc index 8819ba765..d19584163 100644 --- a/qcsrc/server/cl_player.qc +++ b/qcsrc/server/cl_player.qc @@ -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 diff --git a/qcsrc/server/t_jumppads.qc b/qcsrc/server/t_jumppads.qc index 1e72b765a..b07f04d57 100644 --- a/qcsrc/server/t_jumppads.qc +++ b/qcsrc/server/t_jumppads.qc @@ -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; -- 2.39.2