Browse Source

NaN animation time == kaboom

Adam Johnson 10 years ago
parent
commit
7e2595850b
  1. 14
      Sources/Plasma/PubUtilLib/plInterp/plAnimTimeConvert.cpp

14
Sources/Plasma/PubUtilLib/plInterp/plAnimTimeConvert.cpp

@ -508,11 +508,16 @@ float plAnimTimeConvert::WorldToAnimTime(double wSecs)
{
if (secs > fLoopEnd)
{
secs = fmodf(secs - fLoopBegin, fLoopEnd - fLoopBegin) + fLoopBegin;
float result = fmodf(secs - fLoopBegin, fLoopEnd - fLoopBegin) + fLoopBegin;
// are they a dumb ass?
if (!isnan(result))
{
secs = result;
wrapped = true;
}
}
}
}
else
{
if (IGetLatestState()->fStartAnimTime < fLoopBegin)
@ -527,11 +532,16 @@ float plAnimTimeConvert::WorldToAnimTime(double wSecs)
{
if (secs < fLoopBegin)
{
secs = fLoopEnd - fmodf(fLoopEnd - secs, fLoopEnd - fLoopBegin);
float result = fLoopEnd - fmodf(fLoopEnd - secs, fLoopEnd - fLoopBegin);
// are they a dumb ass?
if (!isnan(result))
{
secs = result;
wrapped = true;
}
}
}
}
if (fFlags & kWrap)
{

Loading…
Cancel
Save