Restart player block animation during blocking if necessary

7098-improve-post-process-behavior-with-transparent-objects
Alexei Kotov 2 years ago
parent 180963488f
commit 1db9247c45

@ -385,9 +385,17 @@ namespace MWMechanics
bool knockout = stats.getFatigue().getCurrent() < 0 || stats.getFatigue().getBase() == 0;
bool recovery = stats.getHitRecovery();
bool knockdown = stats.getKnockedDown();
bool block = stats.getBlock();
bool block = stats.getBlock() && !knockout && !recovery && !knockdown;
bool isSwimming = world->isSwimming(mPtr);
stats.setBlock(false);
if (mPtr == getPlayer() && mHitState == CharState_Block && block)
{
mHitState = CharState_None;
resetCurrentIdleState();
}
if (mHitState != CharState_None)
{
if (!mAnimation->isPlaying(mCurrentHit))
@ -396,7 +404,6 @@ namespace MWMechanics
mCurrentHit.clear();
stats.setKnockedDown(false);
stats.setHitRecovery(false);
stats.setBlock(false);
resetCurrentIdleState();
}
else if (isKnockedOut())
@ -451,7 +458,6 @@ namespace MWMechanics
mCurrentHit.clear();
stats.setKnockedDown(false);
stats.setHitRecovery(false);
stats.setBlock(false);
resetCurrentIdleState();
return;
}

Loading…
Cancel
Save