mirror of
https://github.com/OpenMW/openmw.git
synced 2025-05-08 07:41:24 +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:
commit
e6b6f2ced6
1 changed files with 10 additions and 13 deletions
|
@ -333,6 +333,9 @@ void CharacterController::refreshHitRecoilAnims()
|
||||||
{
|
{
|
||||||
if (!mAnimation->isPlaying(mCurrentHit))
|
if (!mAnimation->isPlaying(mCurrentHit))
|
||||||
{
|
{
|
||||||
|
if (isKnockedOut() && mCurrentHit.empty() && knockout)
|
||||||
|
return;
|
||||||
|
|
||||||
mHitState = CharState_None;
|
mHitState = CharState_None;
|
||||||
mCurrentHit.clear();
|
mCurrentHit.clear();
|
||||||
stats.setKnockedDown(false);
|
stats.setKnockedDown(false);
|
||||||
|
@ -384,18 +387,6 @@ void CharacterController::refreshHitRecoilAnims()
|
||||||
mCurrentHit = chooseRandomGroup(hitStateToAnimGroup(CharState_Hit));
|
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
|
// Cancel upper body animations
|
||||||
if (isKnockedOut() || isKnockedDown())
|
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);
|
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),
|
// 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
|
// the idle animation should be displayed
|
||||||
if (((mUpperBodyState != UpperCharState_Nothing && mUpperBodyState != UpperCharState_WeapEquiped)
|
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();
|
resetCurrentIdleState();
|
||||||
return;
|
return;
|
||||||
|
|
Loading…
Reference in a new issue