From: Rudolf Polzer Date: Wed, 26 Nov 2014 12:53:11 +0000 (+0100) Subject: Improve deadflag handling. X-Git-Tag: xonotic-v0.8.0~140 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=35cf636a20e766a68fca2957de8891e7cf6745bb;p=xonotic%2Fxonotic-data.pk3dir.git Improve deadflag handling. --- diff --git a/qcsrc/server/cl_player.qc b/qcsrc/server/cl_player.qc index c11e92051..22419da95 100644 --- a/qcsrc/server/cl_player.qc +++ b/qcsrc/server/cl_player.qc @@ -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;