From a527cb8349fd1b4e6b0fa12ac70ab83bb78d4449 Mon Sep 17 00:00:00 2001 From: Chris Robinson Date: Fri, 18 Jan 2013 15:22:14 -0800 Subject: [PATCH] Loop the current animation when not dead This should be better, but it's not perfect. It misses the case where start < loop start == loop stop <= stop --- apps/openmw/mwmechanics/character.cpp | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/apps/openmw/mwmechanics/character.cpp b/apps/openmw/mwmechanics/character.cpp index 241033802c..97cdf3f492 100644 --- a/apps/openmw/mwmechanics/character.cpp +++ b/apps/openmw/mwmechanics/character.cpp @@ -79,7 +79,12 @@ void CharacterController::markerEvent(float time, const std::string &evt) if(evt.compare(ms, evt.length()-ms, "loop stop") == 0) { - if(mAnimQueue.size() >= 2 && mAnimQueue[0] == mAnimQueue[1]) + if(mAnimQueue.size() == 0) + { + if(time > 0.0f && mState != CharState_Dead) + mAnimation->play(mCurrentGroup, "loop start"); + } + else if(mAnimQueue.size() >= 2 && mAnimQueue[0] == mAnimQueue[1]) { mAnimQueue.pop_front(); mAnimation->play(mCurrentGroup, "loop start"); @@ -89,7 +94,12 @@ void CharacterController::markerEvent(float time, const std::string &evt) if(evt.compare(ms, evt.length()-ms, "stop") == 0) { - if(mAnimQueue.size() >= 2 && mAnimQueue[0] == mAnimQueue[1]) + if(mAnimQueue.size() == 0) + { + if(time > 0.0f && mState != CharState_Dead) + mAnimation->play(mCurrentGroup, "loop start"); + } + else if(mAnimQueue.size() >= 2 && mAnimQueue[0] == mAnimQueue[1]) { mAnimQueue.pop_front(); mAnimation->play(mCurrentGroup, "loop start");