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
This commit is contained in:
Chris Robinson 2013-01-18 15:22:14 -08:00
parent c7684cb979
commit a527cb8349

View file

@ -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");