From c610a58cf0a7677baf0b52319497cad21f25e509 Mon Sep 17 00:00:00 2001 From: Andrei Kortunov Date: Sun, 28 Apr 2019 21:50:31 +0400 Subject: [PATCH] Improve reset of idle animations (bug #4847) --- CHANGELOG.md | 1 + apps/openmw/mwmechanics/character.cpp | 10 ++++------ 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index a3cc8178f..c02d7ade4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -50,6 +50,7 @@ Bug #4828: Potion looping effects VFX are not shown for NPCs Bug #4837: CTD when a mesh with NiLODNode root node with particles is loaded Bug #4841: Russian localization ignores implicit keywords + Bug #4847: Idle animation reset oddities Bug #4851: No shadows since switch to OSG Bug #4860: Actors outside of processing range visible for one frame after spawning Bug #4867: Arbitrary text after local variable declarations breaks script compilation diff --git a/apps/openmw/mwmechanics/character.cpp b/apps/openmw/mwmechanics/character.cpp index 9f92f8890..b3078f5af 100644 --- a/apps/openmw/mwmechanics/character.cpp +++ b/apps/openmw/mwmechanics/character.cpp @@ -350,11 +350,6 @@ void CharacterController::refreshJumpAnims(const WeaponInfo* weap, JumpingState if (!force && jump == mJumpState && idle == CharState_None) return; - if (jump == JumpState_InAir) - { - idle = CharState_None; - } - std::string jumpAnimName; MWRender::Animation::BlendMask jumpmask = MWRender::Animation::BlendMask_All; if (jump != JumpState_None) @@ -1686,7 +1681,7 @@ bool CharacterController::updateWeaponState(CharacterState& idle) idle != CharState_IdleSneak && idle != CharState_IdleSwim && mIdleState != CharState_IdleSneak && mIdleState != CharState_IdleSwim) { - idle = CharState_None; + mAnimation->disable(mCurrentIdle); } animPlaying = mAnimation->getInfo(mCurrentWeapon, &complete); @@ -2139,6 +2134,9 @@ void CharacterController::update(float duration, bool animationOnly) jumpstate = JumpState_Landing; vec.z() = 0.0f; + // We should reset idle animation during landing + mAnimation->disable(mCurrentIdle); + float height = cls.getCreatureStats(mPtr).land(isPlayer); float healthLost = getFallDamage(mPtr, height);