|
|
|
@ -411,10 +411,6 @@ void CharacterController::refreshMovementAnims(const WeaponInfo* weap, Character
|
|
|
|
|
if(force || movement != mMovementState)
|
|
|
|
|
{
|
|
|
|
|
mMovementState = movement;
|
|
|
|
|
// Turning animations should not interrupt idle ones
|
|
|
|
|
if (movement != CharState_None && !isTurning())
|
|
|
|
|
mIdleState = CharState_None;
|
|
|
|
|
|
|
|
|
|
std::string movementAnimName;
|
|
|
|
|
MWRender::Animation::BlendMask movemask = MWRender::Animation::BlendMask_All;
|
|
|
|
|
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)
|
|
|
|
|
{
|
|
|
|
|
if(force || idle != mIdleState || (!mAnimation->isPlaying(mCurrentIdle) && mAnimQueue.empty()))
|
|
|
|
|
if(force || idle != mIdleState || mIdleState == CharState_None || (!mAnimation->isPlaying(mCurrentIdle) && mAnimQueue.empty()))
|
|
|
|
|
{
|
|
|
|
|
mIdleState = idle;
|
|
|
|
|
size_t numLoops = ~0ul;
|
|
|
|
@ -562,10 +558,12 @@ void CharacterController::refreshIdleAnims(const WeaponInfo* weap, CharacterStat
|
|
|
|
|
// play until the Loop Stop key 2 to 5 times, then play until the Stop key
|
|
|
|
|
// this replicates original engine behavior for the "Idle1h" 1st-person animation
|
|
|
|
|
numLoops = 1 + Misc::Rng::rollDice(4);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
mAnimation->disable(mCurrentIdle);
|
|
|
|
|
if(!mCurrentIdle.empty())
|
|
|
|
|
mAnimation->disable(mCurrentIdle);
|
|
|
|
|
|
|
|
|
|
mCurrentIdle = idleGroup;
|
|
|
|
|
if(!mCurrentIdle.empty())
|
|
|
|
|
mAnimation->play(mCurrentIdle, idlePriority, MWRender::Animation::BlendMask_All, false,
|
|
|
|
@ -2093,7 +2091,15 @@ void CharacterController::update(float duration)
|
|
|
|
|
|
|
|
|
|
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
|
|
|
|
|
updateAnimQueue();
|
|
|
|
|