1
0
Fork 0
mirror of https://github.com/OpenMW/openmw.git synced 2025-01-21 03:53:54 +00:00

Fix looping anims that dont have "loop start"

This commit is contained in:
Chris Robinson 2013-04-05 08:27:26 -07:00
parent bf0ae3ae72
commit af2a38db38

View file

@ -307,7 +307,15 @@ void Animation::reset(const std::string &start, const std::string &stop)
else
{
mNextKey = mCurrentKeys->begin();
mCurrentTime = 0.0f;
while(mNextKey != mCurrentKeys->end() && mNextKey->second != "start")
mNextKey++;
if(mNextKey != mCurrentKeys->end())
mCurrentTime = mNextKey->first;
else
{
mNextKey = mCurrentKeys->begin();
mCurrentTime = 0.0f;
}
}
if(stop.length() > 0)