diff --git a/Sources/Plasma/PubUtilLib/plInterp/plAnimTimeConvert.cpp b/Sources/Plasma/PubUtilLib/plInterp/plAnimTimeConvert.cpp index 9f5900cb..ae22cbb1 100644 --- a/Sources/Plasma/PubUtilLib/plInterp/plAnimTimeConvert.cpp +++ b/Sources/Plasma/PubUtilLib/plInterp/plAnimTimeConvert.cpp @@ -508,8 +508,13 @@ float plAnimTimeConvert::WorldToAnimTime(double wSecs) { if (secs > fLoopEnd) { - secs = fmodf(secs - fLoopBegin, fLoopEnd - fLoopBegin) + fLoopBegin; - wrapped = true; + float result = fmodf(secs - fLoopBegin, fLoopEnd - fLoopBegin) + fLoopBegin; + // are they a dumb ass? + if (!isnan(result)) + { + secs = result; + wrapped = true; + } } } } @@ -527,11 +532,16 @@ float plAnimTimeConvert::WorldToAnimTime(double wSecs) { if (secs < fLoopBegin) { - secs = fLoopEnd - fmodf(fLoopEnd - secs, fLoopEnd - fLoopBegin); - wrapped = true; + float result = fLoopEnd - fmodf(fLoopEnd - secs, fLoopEnd - fLoopBegin); + // are they a dumb ass? + if (!isnan(result)) + { + secs = result; + wrapped = true; + } } - } - } + } + } if (fFlags & kWrap) {