mirror of
https://github.com/OpenMW/openmw.git
synced 2025-01-22 20:53:53 +00:00
Play death animation for non-persisting actors with 0 health (bug #4291)
This commit is contained in:
parent
6099735c60
commit
d0619cfb35
1 changed files with 6 additions and 1 deletions
|
@ -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())
|
||||
{
|
||||
// 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();
|
||||
|
|
Loading…
Reference in a new issue