diff --git a/apps/openmw/mwmechanics/actors.cpp b/apps/openmw/mwmechanics/actors.cpp index 76e02ed36d..8c6da4a318 100644 --- a/apps/openmw/mwmechanics/actors.cpp +++ b/apps/openmw/mwmechanics/actors.cpp @@ -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); } diff --git a/apps/openmw/mwmechanics/character.cpp b/apps/openmw/mwmechanics/character.cpp index a494008236..7e52ef3d82 100644 --- a/apps/openmw/mwmechanics/character.cpp +++ b/apps/openmw/mwmechanics/character.cpp @@ -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;