diff --git a/components/nif/niffile.cpp b/components/nif/niffile.cpp index 0f7e658fb..10847e8f4 100644 --- a/components/nif/niffile.cpp +++ b/components/nif/niffile.cpp @@ -318,6 +318,8 @@ void NIFFile::parse() Record *r = NULL; std::string rec = nif.getString(); + if(rec.empty()) + fail("Record number " + Ogre::StringConverter::toString(i) + " out of " + Ogre::StringConverter::toString(recNum) + " is blank."); RecordFactoryEntry const * entry = lookupRecordFactory (rec.c_str ()); diff --git a/components/nif/niffile.hpp b/components/nif/niffile.hpp index 77e0acb9e..29fa3951e 100644 --- a/components/nif/niffile.hpp +++ b/components/nif/niffile.hpp @@ -36,6 +36,7 @@ #include #include #include +#include #include #include @@ -137,8 +138,8 @@ template struct KeyT { float mTime; T mValue; - T mForwardValue; // Only for Quadratic interpolation - T mBackwardValue; // Only for Quadratic interpolation + T mForwardValue; // Only for Quadratic interpolation, and never for QuaternionKeyList + T mBackwardValue; // Only for Quadratic interpolation, and never for QuaternionKeyList float mTension; // Only for TBC interpolation float mBias; // Only for TBC interpolation float mContinuity; // Only for TBC interpolation @@ -184,8 +185,11 @@ struct KeyListT { KeyT &key = mKeys[i]; key.mTime = nif->getFloat(); key.mValue = (nif->*getValue)(); - key.mForwardValue = (nif->*getValue)(); - key.mBackwardValue = (nif->*getValue)(); + if( typeid(Ogre::Quaternion) != typeid(T) ) + { + key.mForwardValue = (nif->*getValue)(); + key.mBackwardValue = (nif->*getValue)(); + } } } else if(mInterpolationType == sTBCInterpolation)