forked from mirror/openmw-tes3mp
Don't try to move objects that aren't in a cell
This commit is contained in:
parent
921ae76ea9
commit
648e3331f5
1 changed files with 8 additions and 5 deletions
|
@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue