mirror of
https://github.com/OpenMW/openmw.git
synced 2025-01-19 20:53:52 +00:00
Merge branch 'objects_can_move_too' into 'master'
Another fallout from MR 722: restore objects handling See merge request OpenMW/openmw!749
This commit is contained in:
commit
0b8cae4af8
1 changed files with 6 additions and 4 deletions
|
@ -1256,12 +1256,14 @@ namespace MWWorld
|
|||
MWWorld::Ptr World::moveObjectBy(const Ptr& ptr, osg::Vec3f vec, bool moveToActive)
|
||||
{
|
||||
auto* actor = mPhysics->getActor(ptr);
|
||||
if (actor)
|
||||
actor->adjustPosition(vec);
|
||||
|
||||
osg::Vec3f newpos = ptr.getRefData().getPosition().asVec3() + vec;
|
||||
if (actor)
|
||||
{
|
||||
actor->adjustPosition(vec);
|
||||
return moveObject(ptr, newpos.x(), newpos.y(), newpos.z(), false, moveToActive && ptr != getPlayerPtr());
|
||||
}
|
||||
return moveObject(ptr, newpos.x(), newpos.y(), newpos.z());
|
||||
}
|
||||
|
||||
void World::scaleObject (const Ptr& ptr, float scale)
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue