From f3f869e99a585554c52fcac1577108a5b3f5a052 Mon Sep 17 00:00:00 2001 From: scrawl Date: Sun, 7 Sep 2014 23:47:57 +0200 Subject: [PATCH] Don't produce NaN's for 0-length controllers in NifOgre::DefaultFunction --- components/nifogre/controller.hpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/components/nifogre/controller.hpp b/components/nifogre/controller.hpp index aa60482e3c..cc750ea65e 100644 --- a/components/nifogre/controller.hpp +++ b/components/nifogre/controller.hpp @@ -89,6 +89,9 @@ namespace NifOgre { if(mDeltaInput) { + if (mStopTime - mStartTime == 0.f) + return 0.f; + mDeltaCount += value*mFrequency; if(mDeltaCount < mStartTime) mDeltaCount = mStopTime - std::fmod(mStartTime - mDeltaCount,