1
0
Fork 1
mirror of https://github.com/TES3MP/openmw-tes3mp.git synced 2025-01-22 00:23:51 +00:00

Avoid looking for the controller if there is no NonAccum node

Also, make sure there is a controller before updating the position.
This commit is contained in:
Chris Robinson 2013-04-24 01:18:08 -07:00
parent 26cc86ffdc
commit 9e05ee53da

View file

@ -538,7 +538,7 @@ void Animation::play(const std::string &groupname, const std::string &start, con
const NifOgre::TextKeyMap &keys = objlist.mTextKeys.begin()->second; const NifOgre::TextKeyMap &keys = objlist.mTextKeys.begin()->second;
NifOgre::NodeTargetValue<Ogre::Real> *nonaccumctrl = NULL; NifOgre::NodeTargetValue<Ogre::Real> *nonaccumctrl = NULL;
if(layeridx == 0) if(layeridx == 0 && mNonAccumRoot)
{ {
for(size_t i = 0;i < objlist.mControllers.size();i++) for(size_t i = 0;i < objlist.mControllers.size();i++)
{ {
@ -601,14 +601,14 @@ Ogre::Vector3 Animation::runAnimation(float duration)
if(mLayer[layeridx].mNextKey->first > targetTime) if(mLayer[layeridx].mNextKey->first > targetTime)
{ {
mLayer[layeridx].mTime = targetTime; mLayer[layeridx].mTime = targetTime;
if(layeridx == 0 && mNonAccumRoot) if(layeridx == 0 && mNonAccumCtrl)
movement += updatePosition(); movement += updatePosition();
break; break;
} }
NifOgre::TextKeyMap::const_iterator key(mLayer[layeridx].mNextKey++); NifOgre::TextKeyMap::const_iterator key(mLayer[layeridx].mNextKey++);
mLayer[layeridx].mTime = key->first; mLayer[layeridx].mTime = key->first;
if(layeridx == 0 && mNonAccumRoot) if(layeridx == 0 && mNonAccumCtrl)
movement += updatePosition(); movement += updatePosition();
mLayer[layeridx].mPlaying = (key != mLayer[layeridx].mStopKey); mLayer[layeridx].mPlaying = (key != mLayer[layeridx].mStopKey);