mirror of
https://github.com/TES3MP/TES3MP.git
synced 2025-09-26 22:45:15 -04:00
Don't activate the initial death animation when skipAnim is set (Fixes #2513)
This commit is contained in:
parent
4d94f38f4b
commit
a7f898057b
@ -701,8 +701,9 @@ CharacterController::CharacterController(const MWWorld::Ptr &ptr, MWRender::Anim
|
|||||||
mIdleState = CharState_Idle;
|
mIdleState = CharState_Idle;
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
int deathindex = mPtr.getClass().getCreatureStats(mPtr).getDeathAnimation();
|
// Set the death state, but don't play it yet
|
||||||
playDeath(1.0f, CharacterState(CharState_Death1 + deathindex));
|
// We will play it in the first frame, but only if no script set the skipAnim flag
|
||||||
|
mDeathState = static_cast<CharacterState>(CharState_Death1 + mPtr.getClass().getCreatureStats(mPtr).getDeathAnimation());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@ -1835,6 +1836,13 @@ void CharacterController::update(float duration)
|
|||||||
}
|
}
|
||||||
else if(cls.getCreatureStats(mPtr).isDead())
|
else if(cls.getCreatureStats(mPtr).isDead())
|
||||||
{
|
{
|
||||||
|
// 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
|
||||||
|
if (!mSkipAnim && mDeathState != CharState_None && mCurrentDeath.empty())
|
||||||
|
{
|
||||||
|
playDeath(1.f, mDeathState);
|
||||||
|
}
|
||||||
|
|
||||||
world->queueMovement(mPtr, osg::Vec3f(0.f, 0.f, 0.f));
|
world->queueMovement(mPtr, osg::Vec3f(0.f, 0.f, 0.f));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user