diff --git a/code/LWOAnimation.cpp b/code/LWOAnimation.cpp index de6d6493c..9f23c13b2 100644 --- a/code/LWOAnimation.cpp +++ b/code/LWOAnimation.cpp @@ -328,7 +328,12 @@ void AnimResolver::DoInterpolation2(std::vector::const_iterator beg, break; } // linear interpolation - default - fill = (*beg).value + ((*end).value - (*beg).value)*(float)(((time - (*beg).time) / ((*end).time - (*beg).time))); + double duration = (*end).time - (*beg).time; + if (duration > 0.0) { + fill = (*beg).value + ((*end).value - (*beg).value)*(float)(((time - (*beg).time) / duration)); + } else { + fill = (*beg).value; + } } // ------------------------------------------------------------------------------------------------