mirror of
https://github.com/TES3MP/openmw-tes3mp.git
synced 2025-03-04 22:19:41 +00:00
Do not stop idle animation in spellcasting stance
This commit is contained in:
parent
b7a448cf42
commit
a73d42e711
1 changed files with 12 additions and 3 deletions
|
@ -561,13 +561,21 @@ void CharacterController::refreshIdleAnims(const WeaponInfo* weap, CharacterStat
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// There is no need to restart anim if the new and old anims are the same.
|
||||||
|
// Just update a number of loops.
|
||||||
|
float startPoint = 0;
|
||||||
|
if (!mCurrentIdle.empty() && mCurrentIdle == idleGroup)
|
||||||
|
{
|
||||||
|
mAnimation->getInfo(mCurrentIdle, &startPoint);
|
||||||
|
}
|
||||||
|
|
||||||
if(!mCurrentIdle.empty())
|
if(!mCurrentIdle.empty())
|
||||||
mAnimation->disable(mCurrentIdle);
|
mAnimation->disable(mCurrentIdle);
|
||||||
|
|
||||||
mCurrentIdle = idleGroup;
|
mCurrentIdle = idleGroup;
|
||||||
if(!mCurrentIdle.empty())
|
if(!mCurrentIdle.empty())
|
||||||
mAnimation->play(mCurrentIdle, idlePriority, MWRender::Animation::BlendMask_All, false,
|
mAnimation->play(mCurrentIdle, idlePriority, MWRender::Animation::BlendMask_All, false,
|
||||||
1.0f, "start", "stop", 0.0f, numLoops, true);
|
1.0f, "start", "stop", startPoint, numLoops, true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2091,12 +2099,13 @@ void CharacterController::update(float duration)
|
||||||
|
|
||||||
if(mAnimQueue.empty() || inwater || sneak)
|
if(mAnimQueue.empty() || inwater || sneak)
|
||||||
{
|
{
|
||||||
// Note: turning animations should not interrupt idle ones
|
// Note: turning animations should not interrupt idle ones.
|
||||||
|
// Also movement should not stop idle animation for spellcasting stance.
|
||||||
if (inwater)
|
if (inwater)
|
||||||
idlestate = CharState_IdleSwim;
|
idlestate = CharState_IdleSwim;
|
||||||
else if (sneak && !inJump)
|
else if (sneak && !inJump)
|
||||||
idlestate = CharState_IdleSneak;
|
idlestate = CharState_IdleSneak;
|
||||||
else if (movestate != CharState_None && !isTurning())
|
else if (movestate != CharState_None && !isTurning() && mWeaponType != WeapType_Spell)
|
||||||
idlestate = CharState_None;
|
idlestate = CharState_None;
|
||||||
else
|
else
|
||||||
idlestate = CharState_Idle;
|
idlestate = CharState_Idle;
|
||||||
|
|
Loading…
Reference in a new issue