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:
parent
d5d832846e
commit
fecb8c1cc4
1 changed files with 8 additions and 2 deletions
|
@ -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);
|
||||||
|
|
Loading…
Reference in a new issue