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) 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; wrapped = true;
} }
} }
} }
}
else else
{ {
if (IGetLatestState()->fStartAnimTime < fLoopBegin) if (IGetLatestState()->fStartAnimTime < fLoopBegin)
@ -527,11 +532,16 @@ float plAnimTimeConvert::WorldToAnimTime(double wSecs)
{ {
if (secs < fLoopBegin) 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; wrapped = true;
} }
} }
} }
}
if (fFlags & kWrap) if (fFlags & kWrap)
{ {

Loading…
Cancel
Save