forked from mirror/openmw-tes3mp
Don't reset the animation when setting the same state
Unless looping is being toggled on.
This commit is contained in:
parent
e0541b52c4
commit
a7b07ee5cf
2 changed files with 13 additions and 4 deletions
|
@ -279,8 +279,7 @@ namespace MWMechanics
|
|||
newstate = CharState_WalkForward;
|
||||
}
|
||||
|
||||
if(iter->second.getState() != newstate)
|
||||
iter->second.setState(newstate, true);
|
||||
iter->second.setState(newstate, true);
|
||||
iter->second.setDirection(dir);
|
||||
}
|
||||
|
||||
|
|
|
@ -215,8 +215,18 @@ void CharacterController::skipAnim()
|
|||
|
||||
void CharacterController::setState(CharacterState state, bool loop)
|
||||
{
|
||||
mState = state;
|
||||
mLoop = loop;
|
||||
if(mState == state)
|
||||
{
|
||||
// If setting the same state again, only reset the animation if looping
|
||||
// is being turned on.
|
||||
if(mLoop == loop || !(mLoop=loop))
|
||||
return;
|
||||
}
|
||||
else
|
||||
{
|
||||
mState = state;
|
||||
mLoop = loop;
|
||||
}
|
||||
|
||||
if(mAnimNames.size() == 0)
|
||||
return;
|
||||
|
|
Loading…
Reference in a new issue