Don't try to move objects that aren't in a cell

This commit is contained in:
Chris Robinson 2013-01-06 23:20:20 -08:00
parent 921ae76ea9
commit 648e3331f5

View file

@ -98,12 +98,15 @@ void Animation::updatePosition(float time)
mAccumRoot->translate(-posdiff);
mLastPosition += posdiff;
/* Finally, move the object based on how much the non-accumulation root moved. */
Ogre::Vector3 newpos(mPtr.getRefData().getPosition().pos);
newpos += mInsert->getOrientation() * posdiff;
if(mPtr.isInCell())
{
/* Finally, move the object based on how much the non-accumulation root moved. */
Ogre::Vector3 newpos(mPtr.getRefData().getPosition().pos);
newpos += mInsert->getOrientation() * posdiff;
MWBase::World *world = MWBase::Environment::get().getWorld();
world->moveObject(mPtr, newpos.x, newpos.y, newpos.z);
MWBase::World *world = MWBase::Environment::get().getWorld();
world->moveObject(mPtr, newpos.x, newpos.y, newpos.z);
}
}
}