From 0dd44109ef385a163aa19c9edbd3699d7d2f83c2 Mon Sep 17 00:00:00 2001 From: Mario Date: Sun, 30 Aug 2015 20:07:45 +1000 Subject: [PATCH] Add a hack to fix players with MOVETYPE_FOLLOW --- qcsrc/common/animdecide.qc | 2 ++ qcsrc/common/animdecide.qh | 1 + qcsrc/server/cl_player.qc | 2 ++ 3 files changed, 5 insertions(+) diff --git a/qcsrc/common/animdecide.qc b/qcsrc/common/animdecide.qc index 8a624aa2a..5c2caa6a7 100644 --- a/qcsrc/common/animdecide.qc +++ b/qcsrc/common/animdecide.qc @@ -158,6 +158,8 @@ vector animdecide_getupperanim(entity e) vector animdecide_getloweranim(entity e) { // death etc. + if(e.anim_state & ANIMSTATE_FOLLOW) + return vec3(((e.anim_state & ANIMSTATE_DUCK) ? e.anim_duckidle_x : e.anim_idle_x), e.anim_time, ANIMPRIO_DEAD); // dead priority so it's above all if(e.anim_state & ANIMSTATE_FROZEN) return vec3(e.anim_idle.x, e.anim_time, ANIMPRIO_DEAD); if(e.anim_state & ANIMSTATE_DEAD1) diff --git a/qcsrc/common/animdecide.qh b/qcsrc/common/animdecide.qh index f1bdcb7e9..d122b6a36 100644 --- a/qcsrc/common/animdecide.qh +++ b/qcsrc/common/animdecide.qh @@ -66,6 +66,7 @@ const int ANIMSTATE_DEAD1 = 1; // base frames: die1 const int ANIMSTATE_DEAD2 = 2; // base frames: die2 const int ANIMSTATE_DUCK = 4; // turns walk into duckwalk, jump into duckjump, etc. const int ANIMSTATE_FROZEN = 8; // force idle +const int ANIMSTATE_FOLLOW = 16; // also force idle // implicit anim states (inferred from velocity, etc.) const int ANIMIMPLICITSTATE_INAIR = 1; diff --git a/qcsrc/server/cl_player.qc b/qcsrc/server/cl_player.qc index 9add7e808..76253977c 100644 --- a/qcsrc/server/cl_player.qc +++ b/qcsrc/server/cl_player.qc @@ -153,6 +153,8 @@ void player_anim (void) int animbits = deadbits; if(self.frozen) animbits |= ANIMSTATE_FROZEN; + if(self.movetype == MOVETYPE_FOLLOW) + animbits |= ANIMSTATE_FOLLOW; if(self.crouch) animbits |= ANIMSTATE_DUCK; animdecide_setstate(self, animbits, false); -- 2.39.2