From: Rudolf Polzer Date: Tue, 6 Dec 2011 15:15:38 +0000 (+0100) Subject: support for duckwalkbackwards anim X-Git-Tag: xonotic-v0.6.0~35^2~12^2~2 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=5ddeca4cffa212a2742c5fbdcde8e7ec0b5bb270;p=xonotic%2Fxonotic-data.pk3dir.git support for duckwalkbackwards anim --- diff --git a/qcsrc/server/cl_player.qc b/qcsrc/server/cl_player.qc index 532b67aef..4d0471237 100644 --- a/qcsrc/server/cl_player.qc +++ b/qcsrc/server/cl_player.qc @@ -230,6 +230,7 @@ void player_setupanimsformodel() self.anim_backright = animfixfps(self, '21 1 1'); self.anim_backleft = animfixfps(self, '22 1 1'); self.anim_melee = animfixfps(self, '23 1 1'); + self.anim_duckwalkbackwards = animfixfps(self, '24 1 1'); // TODO introspect models for finding right "fps" value (1/duration) // reset animstate now setanim(self, self.anim_idle, TRUE, FALSE, TRUE); @@ -286,7 +287,9 @@ void player_anim (void) } else if (self.crouch) { - if (self.movement_x * self.movement_x + self.movement_y * self.movement_y > 20) + if (self.movement_x < 0) + setanim(self, self.anim_duckwalkbackwards, TRUE, FALSE, FALSE); + else if (self.movement_x * self.movement_x + self.movement_y * self.movement_y > 20) setanim(self, self.anim_duckwalk, TRUE, FALSE, FALSE); else setanim(self, self.anim_duckidle, TRUE, FALSE, FALSE); diff --git a/qcsrc/server/defs.qh b/qcsrc/server/defs.qh index c3b6cf3c7..d32c27aad 100644 --- a/qcsrc/server/defs.qh +++ b/qcsrc/server/defs.qh @@ -130,6 +130,7 @@ float maxclients; .vector anim_draw; // player pulls out a weapon // .vector anim_duck; // player crouches (from idle to duckidle) .vector anim_duckwalk; // player walking while crouching +.vector anim_duckwalkbackwards; // player walking while crouching .vector anim_duckjump; // player jumping from a crouch .vector anim_duckidle; // player idling while crouching .vector anim_idle; // player standing