From ebaa6fb5a212817d3052b738998f5f4d19e6bb5b Mon Sep 17 00:00:00 2001 From: Andrei Kortunov Date: Tue, 12 Jun 2018 09:55:43 +0400 Subject: [PATCH] Play death scream only once --- apps/openmw/mwmechanics/character.cpp | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/apps/openmw/mwmechanics/character.cpp b/apps/openmw/mwmechanics/character.cpp index eb89fe785..8439a4e4c 100644 --- a/apps/openmw/mwmechanics/character.cpp +++ b/apps/openmw/mwmechanics/character.cpp @@ -728,14 +728,6 @@ void CharacterController::playRandomDeath(float startpoint) MWBase::Environment::get().getWorld()->useDeathCamera(); } - // Do not interrupt scripted animation by death - if (!mAnimQueue.empty()) - { - AnimationQueueEntry& first = mAnimQueue.front(); - if (first.mPersist && isAnimPlaying(first.mGroup)) - return; - } - if(mHitState == CharState_SwimKnockDown && mAnimation->hasAnimation("swimdeathknockdown")) { mDeathState = CharState_SwimDeathKnockDown; @@ -760,6 +752,15 @@ void CharacterController::playRandomDeath(float startpoint) { mDeathState = chooseRandomDeathState(); } + + // Do not interrupt scripted animation by death + if (!mAnimQueue.empty()) + { + AnimationQueueEntry& first = mAnimQueue.front(); + if (first.mPersist && isAnimPlaying(first.mGroup)) + return; + } + playDeath(startpoint, mDeathState); }