1
0
Fork 0
mirror of https://github.com/OpenMW/openmw.git synced 2025-01-19 22:53:53 +00:00

Merge branch 'cuphead48' into 'openmw-48'

Regression fixes for animation-less knockout [0.48]

See merge request OpenMW/openmw!2590
This commit is contained in:
psi29a 2023-01-07 22:19:06 +00:00
commit e6b6f2ced6

View file

@ -333,6 +333,9 @@ void CharacterController::refreshHitRecoilAnims()
{
if (!mAnimation->isPlaying(mCurrentHit))
{
if (isKnockedOut() && mCurrentHit.empty() && knockout)
return;
mHitState = CharState_None;
mCurrentHit.clear();
stats.setKnockedDown(false);
@ -384,18 +387,6 @@ void CharacterController::refreshHitRecoilAnims()
mCurrentHit = chooseRandomGroup(hitStateToAnimGroup(CharState_Hit));
}
if (!mAnimation->hasAnimation(mCurrentHit))
{
// The hit animation is missing. Reset the current hit state and immediately cancel all states as if the animation were instantaneous.
mHitState = CharState_None;
mCurrentHit.clear();
stats.setKnockedDown(false);
stats.setHitRecovery(false);
stats.setBlock(false);
resetCurrentIdleState();
return;
}
// Cancel upper body animations
if (isKnockedOut() || isKnockedDown())
{
@ -413,6 +404,12 @@ void CharacterController::refreshHitRecoilAnims()
}
}
if (!mAnimation->hasAnimation(mCurrentHit))
{
mCurrentHit.clear();
return;
}
mAnimation->play(mCurrentHit, priority, MWRender::Animation::BlendMask_All, true, 1, startKey, stopKey, 0.0f, ~0ul);
}
@ -681,7 +678,7 @@ void CharacterController::refreshIdleAnims(CharacterState idle, bool force)
// FIXME: if one of the below states is close to their last animation frame (i.e. will be disabled in the coming update),
// the idle animation should be displayed
if (((mUpperBodyState != UpperCharState_Nothing && mUpperBodyState != UpperCharState_WeapEquiped)
|| mMovementState != CharState_None || mHitState != CharState_None) && !mPtr.getClass().isBipedal(mPtr))
|| mMovementState != CharState_None || !mCurrentHit.empty()) && !mPtr.getClass().isBipedal(mPtr))
{
resetCurrentIdleState();
return;