mirror of
https://gitlab.com/OpenMW/openmw.git
synced 2025-03-30 16:20:21 +00:00
Merge branch 'cuphead' into 'master'
Regression fixes for animation-less knockout See merge request OpenMW/openmw!2588
This commit is contained in:
commit
9aab934028
@ -400,6 +400,9 @@ namespace MWMechanics
|
|||||||
{
|
{
|
||||||
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);
|
||||||
@ -450,18 +453,6 @@ namespace MWMechanics
|
|||||||
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);
|
|
||||||
resetCurrentIdleState();
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Cancel upper body animations
|
// Cancel upper body animations
|
||||||
if (isKnockedOut() || isKnockedDown())
|
if (isKnockedOut() || isKnockedDown())
|
||||||
{
|
{
|
||||||
@ -479,6 +470,12 @@ namespace MWMechanics
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!mAnimation->hasAnimation(mCurrentHit))
|
||||||
|
{
|
||||||
|
mCurrentHit.clear();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
mAnimation->play(
|
mAnimation->play(
|
||||||
mCurrentHit, priority, MWRender::Animation::BlendMask_All, true, 1, startKey, stopKey, 0.0f, ~0ul);
|
mCurrentHit, priority, MWRender::Animation::BlendMask_All, true, 1, startKey, stopKey, 0.0f, ~0ul);
|
||||||
}
|
}
|
||||||
@ -755,7 +752,7 @@ namespace MWMechanics
|
|||||||
// FIXME: if one of the below states is close to their last animation frame (i.e. will be disabled in the coming
|
// 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
|
// update), the idle animation should be displayed
|
||||||
if (((mUpperBodyState != UpperBodyState::None && mUpperBodyState != UpperBodyState::WeaponEquipped)
|
if (((mUpperBodyState != UpperBodyState::None && mUpperBodyState != UpperBodyState::WeaponEquipped)
|
||||||
|| mMovementState != CharState_None || mHitState != CharState_None)
|
|| mMovementState != CharState_None || !mCurrentHit.empty())
|
||||||
&& !mPtr.getClass().isBipedal(mPtr))
|
&& !mPtr.getClass().isBipedal(mPtr))
|
||||||
{
|
{
|
||||||
resetCurrentIdleState();
|
resetCurrentIdleState();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user