1
0
Fork 1
mirror of https://github.com/TES3MP/openmw-tes3mp.git synced 2025-01-19 22:23:51 +00:00

Properly handle starting an animation at the end

This commit is contained in:
Chris Robinson 2013-07-28 09:56:03 -07:00
parent 54f91d4b3a
commit 465f4d2063

View file

@ -589,7 +589,7 @@ void Animation::play(const std::string &groupname, int priority, int groups, boo
state.mSource = *iter;
state.mSpeedMult = speedmult;
state.mLoopCount = loops;
state.mPlaying = true;
state.mPlaying = (state.mTime < state.mStopTime);
state.mPriority = priority;
state.mGroups = groups;
state.mAutoDisable = autodisable;
@ -602,6 +602,22 @@ void Animation::play(const std::string &groupname, int priority, int groups, boo
textkey++;
}
if(state.mTime >= state.mLoopStopTime && state.mLoopCount > 0)
{
state.mLoopCount--;
state.mTime = state.mLoopStartTime;
state.mPlaying = true;
if(state.mTime >= state.mLoopStopTime)
break;
textkey = textkeys.lower_bound(state.mTime);
while(textkey != textkeys.end() && textkey->first <= state.mTime)
{
handleTextKey(state, groupname, textkey);
textkey++;
}
}
break;
}
}