mirror of
https://github.com/OpenMW/openmw.git
synced 2025-02-03 19:45:34 +00:00
Do not play min attack -> max attack animation when attack strength is 0 (bug #4591)
This commit is contained in:
parent
8a48258b1b
commit
e444b9581c
1 changed files with 17 additions and 5 deletions
|
@ -1670,11 +1670,6 @@ bool CharacterController::updateWeaponState()
|
||||||
std::string start, stop;
|
std::string start, stop;
|
||||||
switch(mUpperBodyState)
|
switch(mUpperBodyState)
|
||||||
{
|
{
|
||||||
case UpperCharState_StartToMinAttack:
|
|
||||||
start = mAttackType+" min attack";
|
|
||||||
stop = mAttackType+" max attack";
|
|
||||||
mUpperBodyState = UpperCharState_MinAttackToMaxAttack;
|
|
||||||
break;
|
|
||||||
case UpperCharState_MinAttackToMaxAttack:
|
case UpperCharState_MinAttackToMaxAttack:
|
||||||
//hack to avoid body pos desync when jumping/sneaking in 'max attack' state
|
//hack to avoid body pos desync when jumping/sneaking in 'max attack' state
|
||||||
if(!mAnimation->isPlaying(mCurrentWeapon))
|
if(!mAnimation->isPlaying(mCurrentWeapon))
|
||||||
|
@ -1682,6 +1677,23 @@ bool CharacterController::updateWeaponState()
|
||||||
MWRender::Animation::BlendMask_All, false,
|
MWRender::Animation::BlendMask_All, false,
|
||||||
0, mAttackType+" min attack", mAttackType+" max attack", 0.999f, 0);
|
0, mAttackType+" min attack", mAttackType+" max attack", 0.999f, 0);
|
||||||
break;
|
break;
|
||||||
|
case UpperCharState_StartToMinAttack:
|
||||||
|
{
|
||||||
|
// If actor is already stopped prepairing attack, do not play the "min attack -> max attack" part.
|
||||||
|
// Happens if the player did not hold the attack button.
|
||||||
|
// Note: if the "min attack"->"max attack" is a stub, "play" it anyway. Attack strength will be 1.
|
||||||
|
float minAttackTime = mAnimation->getTextKeyTime(mCurrentWeapon+": "+mAttackType+" "+"min attack");
|
||||||
|
float maxAttackTime = mAnimation->getTextKeyTime(mCurrentWeapon+": "+mAttackType+" "+"max attack");
|
||||||
|
if (mAttackingOrSpell || minAttackTime == maxAttackTime)
|
||||||
|
{
|
||||||
|
start = mAttackType+" min attack";
|
||||||
|
stop = mAttackType+" max attack";
|
||||||
|
mUpperBodyState = UpperCharState_MinAttackToMaxAttack;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
playSwishSound(0.0f);
|
||||||
|
}
|
||||||
|
// Fall-through
|
||||||
case UpperCharState_MaxAttackToMinHit:
|
case UpperCharState_MaxAttackToMinHit:
|
||||||
if(mAttackType == "shoot")
|
if(mAttackType == "shoot")
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in a new issue