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

Fix the completion amount for 0-length anims

This commit is contained in:
Chris Robinson 2013-07-23 05:30:37 -07:00
parent d5d832846e
commit fecb8c1cc4

View file

@ -670,8 +670,14 @@ bool Animation::getInfo(const std::string &groupname, float *complete, float *sp
return false; return false;
} }
if(complete) *complete = (iter->second.mTime - iter->second.mStartKey->first) / if(complete)
{
if(iter->second.mStopKey->first > iter->second.mStartKey->first)
*complete = (iter->second.mTime - iter->second.mStartKey->first) /
(iter->second.mStopKey->first - iter->second.mStartKey->first); (iter->second.mStopKey->first - iter->second.mStartKey->first);
else
*complete = (iter->second.mPlaying ? 0.0f : 1.0f);
}
if(speedmult) *speedmult = iter->second.mSpeedMult; if(speedmult) *speedmult = iter->second.mSpeedMult;
if(start) *start = iter->second.mStartKey->second.substr(groupname.size()+2); if(start) *start = iter->second.mStartKey->second.substr(groupname.size()+2);
if(stop) *stop = iter->second.mStopKey->second.substr(groupname.size()+2); if(stop) *stop = iter->second.mStopKey->second.substr(groupname.size()+2);