mirror of
https://github.com/OpenMW/openmw.git
synced 2025-04-02 13:06:39 +00:00
Fix outdated bone locations when camera view is changed while paralyzed
This commit is contained in:
parent
d1a29300f0
commit
d26d5f6c26
1 changed files with 37 additions and 34 deletions
|
@ -1640,6 +1640,7 @@ void CharacterController::update(float duration)
|
|||
else
|
||||
forcestateupdate = updateCreatureState() || forcestateupdate;
|
||||
|
||||
if (!mSkipAnim)
|
||||
refreshCurrentAnims(idlestate, movestate, forcestateupdate);
|
||||
if (inJump)
|
||||
mMovementAnimationControlled = false;
|
||||
|
@ -1672,6 +1673,7 @@ void CharacterController::update(float duration)
|
|||
// Can't reset jump state (mPosition[2]) here; we don't know for sure whether the PhysicSystem will actually handle it in this frame
|
||||
// due to the fixed minimum timestep used for the physics update. It will be reset in PhysicSystem::move once the jump is handled.
|
||||
|
||||
if (!mSkipAnim)
|
||||
updateHeadTracking(duration);
|
||||
}
|
||||
else if(cls.getCreatureStats(mPtr).isDead())
|
||||
|
@ -1679,9 +1681,7 @@ void CharacterController::update(float duration)
|
|||
world->queueMovement(mPtr, Ogre::Vector3(0.0f));
|
||||
}
|
||||
|
||||
if(!mSkipAnim)
|
||||
{
|
||||
Ogre::Vector3 moved = mAnimation->runAnimation(duration);
|
||||
Ogre::Vector3 moved = mAnimation->runAnimation(mSkipAnim ? 0.f : duration);
|
||||
if(duration > 0.0f)
|
||||
moved /= duration;
|
||||
else
|
||||
|
@ -1707,12 +1707,13 @@ void CharacterController::update(float duration)
|
|||
moved *= (l / newLength);
|
||||
}
|
||||
|
||||
if (mSkipAnim)
|
||||
mAnimation->updateEffects(duration);
|
||||
|
||||
// Update movement
|
||||
if(mMovementAnimationControlled && mPtr.getClass().isActor())
|
||||
world->queueMovement(mPtr, moved);
|
||||
}
|
||||
else
|
||||
mAnimation->updateEffects(duration);
|
||||
|
||||
mSkipAnim = false;
|
||||
|
||||
mAnimation->enableHeadAnimation(cls.isActor() && !cls.getCreatureStats(mPtr).isDead());
|
||||
|
@ -1781,6 +1782,8 @@ void CharacterController::forceStateUpdate()
|
|||
{
|
||||
playRandomDeath();
|
||||
}
|
||||
|
||||
mAnimation->runAnimation(0.f);
|
||||
}
|
||||
|
||||
bool CharacterController::kill()
|
||||
|
|
Loading…
Reference in a new issue