]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
support for duckwalkbackwards anim
authorRudolf Polzer <divverent@alientrap.org>
Tue, 6 Dec 2011 15:15:38 +0000 (16:15 +0100)
committerRudolf Polzer <divverent@alientrap.org>
Tue, 6 Dec 2011 15:15:38 +0000 (16:15 +0100)
qcsrc/server/cl_player.qc
qcsrc/server/defs.qh

index 532b67aef7714555b6d93446c23f6e9756279c26..4d04712379744f15809b4860e385a46ac6fd5ad5 100644 (file)
@@ -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);
index c3b6cf3c71122c1b57cc6478b272339b1c746362..d32c27aad13fa54ccd4b6187de649c5b5282c986 100644 (file)
@@ -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