mirror of
https://github.com/OpenMW/openmw.git
synced 2025-06-21 13:11:33 +00:00
Update idle animations after reset of mIdleState (bug #4531)
This commit is contained in:
parent
66a8402cdf
commit
b7a448cf42
2 changed files with 15 additions and 8 deletions
|
@ -81,6 +81,7 @@
|
||||||
Bug #4503: Cast and ExplodeSpell commands increase alteration skill
|
Bug #4503: Cast and ExplodeSpell commands increase alteration skill
|
||||||
Bug #4510: Division by zero in MWMechanics::CreatureStats::setAttribute
|
Bug #4510: Division by zero in MWMechanics::CreatureStats::setAttribute
|
||||||
Bug #4519: Knockdown does not discard movement in the 1st-person mode
|
Bug #4519: Knockdown does not discard movement in the 1st-person mode
|
||||||
|
Bug #4531: Movement does not reset idle animations
|
||||||
Bug #4539: Paper Doll is affected by GUI scaling
|
Bug #4539: Paper Doll is affected by GUI scaling
|
||||||
Bug #4545: Creatures flee from werewolves
|
Bug #4545: Creatures flee from werewolves
|
||||||
Bug #4551: Replace 0 sound range with default range separately
|
Bug #4551: Replace 0 sound range with default range separately
|
||||||
|
|
|
@ -411,10 +411,6 @@ void CharacterController::refreshMovementAnims(const WeaponInfo* weap, Character
|
||||||
if(force || movement != mMovementState)
|
if(force || movement != mMovementState)
|
||||||
{
|
{
|
||||||
mMovementState = movement;
|
mMovementState = movement;
|
||||||
// Turning animations should not interrupt idle ones
|
|
||||||
if (movement != CharState_None && !isTurning())
|
|
||||||
mIdleState = CharState_None;
|
|
||||||
|
|
||||||
std::string movementAnimName;
|
std::string movementAnimName;
|
||||||
MWRender::Animation::BlendMask movemask = MWRender::Animation::BlendMask_All;
|
MWRender::Animation::BlendMask movemask = MWRender::Animation::BlendMask_All;
|
||||||
const StateInfo *movestate = std::find_if(sMovementList, sMovementListEnd, FindCharState(mMovementState));
|
const StateInfo *movestate = std::find_if(sMovementList, sMovementListEnd, FindCharState(mMovementState));
|
||||||
|
@ -531,7 +527,7 @@ void CharacterController::refreshMovementAnims(const WeaponInfo* weap, Character
|
||||||
|
|
||||||
void CharacterController::refreshIdleAnims(const WeaponInfo* weap, CharacterState idle, bool force)
|
void CharacterController::refreshIdleAnims(const WeaponInfo* weap, CharacterState idle, bool force)
|
||||||
{
|
{
|
||||||
if(force || idle != mIdleState || (!mAnimation->isPlaying(mCurrentIdle) && mAnimQueue.empty()))
|
if(force || idle != mIdleState || mIdleState == CharState_None || (!mAnimation->isPlaying(mCurrentIdle) && mAnimQueue.empty()))
|
||||||
{
|
{
|
||||||
mIdleState = idle;
|
mIdleState = idle;
|
||||||
size_t numLoops = ~0ul;
|
size_t numLoops = ~0ul;
|
||||||
|
@ -565,7 +561,9 @@ void CharacterController::refreshIdleAnims(const WeaponInfo* weap, CharacterStat
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
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,
|
||||||
|
@ -2093,7 +2091,15 @@ void CharacterController::update(float duration)
|
||||||
|
|
||||||
if(mAnimQueue.empty() || inwater || sneak)
|
if(mAnimQueue.empty() || inwater || sneak)
|
||||||
{
|
{
|
||||||
idlestate = (inwater ? CharState_IdleSwim : (sneak && !inJump ? CharState_IdleSneak : CharState_Idle));
|
// Note: turning animations should not interrupt idle ones
|
||||||
|
if (inwater)
|
||||||
|
idlestate = CharState_IdleSwim;
|
||||||
|
else if (sneak && !inJump)
|
||||||
|
idlestate = CharState_IdleSneak;
|
||||||
|
else if (movestate != CharState_None && !isTurning())
|
||||||
|
idlestate = CharState_None;
|
||||||
|
else
|
||||||
|
idlestate = CharState_Idle;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
updateAnimQueue();
|
updateAnimQueue();
|
||||||
|
|
Loading…
Reference in a new issue