Merge pull request #1772 from akortunov/deathanim

Fast-forward death animation to end if death animation was finished earlier
pull/456/head
Bret Curtis 7 years ago committed by GitHub
commit b619c0de2d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -2026,10 +2026,11 @@ void CharacterController::update(float duration)
{ {
// initial start of death animation for actors that started the game as dead // initial start of death animation for actors that started the game as dead
// not done in constructor since we need to give scripts a chance to set the mSkipAnim flag // not done in constructor since we need to give scripts a chance to set the mSkipAnim flag
if (!mSkipAnim && mDeathState != CharState_None && mCurrentDeath.empty() && cls.isPersistent(mPtr)) if (!mSkipAnim && mDeathState != CharState_None && mCurrentDeath.empty())
{ {
// Fast-forward death animation to end for persisting corpses // Fast-forward death animation to end for persisting corpses or corpses after end of death animation
playDeath(1.f, mDeathState); if (cls.isPersistent(mPtr) || cls.getCreatureStats(mPtr).isDeathAnimationFinished())
playDeath(1.f, mDeathState);
} }
// We must always queue movement, even if there is none, to apply gravity. // We must always queue movement, even if there is none, to apply gravity.
world->queueMovement(mPtr, osg::Vec3f(0.f, 0.f, 0.f)); world->queueMovement(mPtr, osg::Vec3f(0.f, 0.f, 0.f));

Loading…
Cancel
Save