From d0619cfb3500a43bcf6019a0f2e7c206a360f447 Mon Sep 17 00:00:00 2001 From: Andrei Kortunov Date: Mon, 11 Jun 2018 18:52:20 +0400 Subject: [PATCH] Play death animation for non-persisting actors with 0 health (bug #4291) --- apps/openmw/mwmechanics/character.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/apps/openmw/mwmechanics/character.cpp b/apps/openmw/mwmechanics/character.cpp index 795675fb3..daab8cdeb 100644 --- a/apps/openmw/mwmechanics/character.cpp +++ b/apps/openmw/mwmechanics/character.cpp @@ -2023,7 +2023,11 @@ void CharacterController::update(float duration) // not done in constructor since we need to give scripts a chance to set the mSkipAnim flag if (!mSkipAnim && mDeathState != CharState_None && mCurrentDeath.empty()) { - playDeath(1.f, mDeathState); + // Fast-forward death animation to end for persisting corpses + if (cls.isPersistent(mPtr)) + playDeath(1.f, mDeathState); + else + playDeath(0.f, mDeathState); } // We must always queue movement, even if there is none, to apply gravity. world->queueMovement(mPtr, osg::Vec3f(0.f, 0.f, 0.f)); @@ -2239,6 +2243,7 @@ void CharacterController::forceStateUpdate() clearAnimQueue(); refreshCurrentAnims(mIdleState, mMovementState, mJumpState, true); + if(mDeathState != CharState_None) { playRandomDeath();