mirror of
https://github.com/TES3MP/openmw-tes3mp.git
synced 2025-01-30 15:15:31 +00:00
Sometimes play 1st-person weapon idle to Stop key
This commit is contained in:
parent
cc7b1f8543
commit
f4cc5d0399
1 changed files with 4 additions and 2 deletions
|
@ -471,6 +471,7 @@ void CharacterController::refreshIdleAnims(const WeaponInfo* weap, CharacterStat
|
||||||
if(force || idle != mIdleState)
|
if(force || idle != mIdleState)
|
||||||
{
|
{
|
||||||
mIdleState = idle;
|
mIdleState = idle;
|
||||||
|
size_t numLoops = ~0ul;
|
||||||
|
|
||||||
std::string idle;
|
std::string idle;
|
||||||
MWRender::Animation::AnimPriority idlePriority (Priority_Default);
|
MWRender::Animation::AnimPriority idlePriority (Priority_Default);
|
||||||
|
@ -494,14 +495,15 @@ void CharacterController::refreshIdleAnims(const WeaponInfo* weap, CharacterStat
|
||||||
idle += weap->shortgroup;
|
idle += weap->shortgroup;
|
||||||
if(!mAnimation->hasAnimation(idle))
|
if(!mAnimation->hasAnimation(idle))
|
||||||
idle = "idle";
|
idle = "idle";
|
||||||
}
|
numLoops = 1 + Misc::Rng::rollDice(4);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
mAnimation->disable(mCurrentIdle);
|
mAnimation->disable(mCurrentIdle);
|
||||||
mCurrentIdle = idle;
|
mCurrentIdle = idle;
|
||||||
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, ~0ul, true);
|
1.0f, "start", "stop", 0.0f, numLoops, true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue