From f4cc5d0399fd4e38ace958d5a6cb6204c730b5d8 Mon Sep 17 00:00:00 2001 From: Allofich Date: Thu, 25 Aug 2016 21:17:40 +0900 Subject: [PATCH] Sometimes play 1st-person weapon idle to Stop key --- apps/openmw/mwmechanics/character.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/apps/openmw/mwmechanics/character.cpp b/apps/openmw/mwmechanics/character.cpp index 637c24300..7be10a581 100644 --- a/apps/openmw/mwmechanics/character.cpp +++ b/apps/openmw/mwmechanics/character.cpp @@ -471,6 +471,7 @@ void CharacterController::refreshIdleAnims(const WeaponInfo* weap, CharacterStat if(force || idle != mIdleState) { mIdleState = idle; + size_t numLoops = ~0ul; std::string idle; MWRender::Animation::AnimPriority idlePriority (Priority_Default); @@ -494,14 +495,15 @@ void CharacterController::refreshIdleAnims(const WeaponInfo* weap, CharacterStat idle += weap->shortgroup; if(!mAnimation->hasAnimation(idle)) idle = "idle"; - } + numLoops = 1 + Misc::Rng::rollDice(4); + } } mAnimation->disable(mCurrentIdle); mCurrentIdle = idle; if(!mCurrentIdle.empty()) mAnimation->play(mCurrentIdle, idlePriority, MWRender::Animation::BlendMask_All, false, - 1.0f, "start", "stop", 0.0f, ~0ul, true); + 1.0f, "start", "stop", 0.0f, numLoops, true); } }