mirror of
https://gitlab.com/OpenMW/openmw.git
synced 2025-05-03 07:17:59 +03:00
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);
|
mAccumRoot->translate(-posdiff);
|
||||||
mLastPosition += posdiff;
|
mLastPosition += posdiff;
|
||||||
|
|
||||||
/* Finally, move the object based on how much the non-accumulation root moved. */
|
if(mPtr.isInCell())
|
||||||
Ogre::Vector3 newpos(mPtr.getRefData().getPosition().pos);
|
{
|
||||||
newpos += mInsert->getOrientation() * 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;
|
||||||
|
|
||||||
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);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue