From 8fa1b56efcbfc9869c9b22d14f0c1bfb72853de4 Mon Sep 17 00:00:00 2001 From: Chris Robinson Date: Thu, 17 Jan 2013 16:34:26 -0800 Subject: [PATCH] Loop the current animation if there's nothing more queued --- apps/openmw/mwmechanics/character.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/apps/openmw/mwmechanics/character.cpp b/apps/openmw/mwmechanics/character.cpp index 9fa2c74be..a42771e0b 100644 --- a/apps/openmw/mwmechanics/character.cpp +++ b/apps/openmw/mwmechanics/character.cpp @@ -107,6 +107,11 @@ void CharacterController::markerEvent(const std::string &evt) } } } + else + { + if(evt.compare(ms, evt.length()-ms, "loop stop") == 0 || evt.compare(ms, evt.length()-ms, "stop") == 0) + mAnimation->play(mCurrentGroup, "loop start"); + } } @@ -130,6 +135,7 @@ void CharacterController::playGroup(const std::string &groupname, int mode, int mAnimQueue.clear(); while(count-- > 0) mAnimQueue.push_back(groupname); + mAnimQueue.push_back("idle"); mCurrentGroup = groupname; mAnimation->play(mCurrentGroup, ((mode==2) ? "loop start" : "start")); } @@ -138,6 +144,7 @@ void CharacterController::playGroup(const std::string &groupname, int mode, int mAnimQueue.resize(1); while(count-- > 0) mAnimQueue.push_back(groupname); + mAnimQueue.push_back("idle"); } } }