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