]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Improve deadflag handling.
authorRudolf Polzer <divVerent@xonotic.org>
Wed, 26 Nov 2014 12:53:11 +0000 (13:53 +0100)
committerRudolf Polzer <divVerent@xonotic.org>
Wed, 26 Nov 2014 12:53:11 +0000 (13:53 +0100)
qcsrc/server/cl_player.qc

index c11e92051074b7fcbf15b208b774f14d96c00d88..22419da9507facd58f97ee575f8895476bd2c757 100644 (file)
@@ -240,11 +240,18 @@ void player_setupanimsformodel()
 void player_anim (void)
 {
        float deadbits = (self.anim_state & (ANIMSTATE_DEAD1 | ANIMSTATE_DEAD2));
-       if(self.deadflag && !deadbits)
-               if(random() < 0.5)
-                       deadbits = ANIMSTATE_DEAD1;
-               else
-                       deadbits = ANIMSTATE_DEAD2;
+       if(self.deadflag) {
+               if (!deadbits) {
+                       // Decide on which death animation to use.
+                       if(random() < 0.5)
+                               deadbits = ANIMSTATE_DEAD1;
+                       else
+                               deadbits = ANIMSTATE_DEAD2;
+               }
+       } else {
+               // Clear a previous death animation.
+               deadbits = 0;
+       }
        float animbits = deadbits;
        if(self.frozen)
                animbits |= ANIMSTATE_FROZEN;