]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
fix pain animation overriding melee anim
authorFruitieX <fruitiex@gmail.com>
Wed, 25 May 2011 23:46:39 +0000 (02:46 +0300)
committerFruitieX <fruitiex@gmail.com>
Wed, 25 May 2011 23:46:39 +0000 (02:46 +0300)
qcsrc/server/cl_player.qc

index 04ce7c0d35016166119514aaa3c99e80101638dc..4de169221e6d976b66d8f3c2cd04927e31ba761c 100644 (file)
@@ -486,10 +486,13 @@ void PlayerDamage (entity inflictor, entity attacker, float damage, float deatht
                                if(sv_gentle < 1) {
                                        if(self.classname != "body") // pain anim is BORKED on our ZYMs, FIXME remove this once we have good models
                                        {
-                                               if (random() > 0.5)
-                                                       setanim(self, self.anim_pain1, FALSE, TRUE, TRUE);
-                                               else
-                                                       setanim(self, self.anim_pain2, FALSE, TRUE, TRUE);
+                                               if (!self.animstate_override)
+                                               {
+                                                       if (random() > 0.5)
+                                                               setanim(self, self.anim_pain1, FALSE, TRUE, TRUE);
+                                                       else
+                                                               setanim(self, self.anim_pain2, FALSE, TRUE, TRUE);
+                                               }
                                        }
 
                                        if(sound_allowed(MSG_BROADCAST, attacker))