Merge branch 'objects_can_move_too' into 'master'

Another fallout from MR 722: restore objects handling

See merge request OpenMW/openmw!749
pull/3068/head
psi29a 4 years ago
commit 0b8cae4af8

@ -1256,11 +1256,13 @@ namespace MWWorld
MWWorld::Ptr World::moveObjectBy(const Ptr& ptr, osg::Vec3f vec, bool moveToActive)
{
auto* actor = mPhysics->getActor(ptr);
osg::Vec3f newpos = ptr.getRefData().getPosition().asVec3() + vec;
if (actor)
{
actor->adjustPosition(vec);
osg::Vec3f newpos = ptr.getRefData().getPosition().asVec3() + vec;
return moveObject(ptr, newpos.x(), newpos.y(), newpos.z(), false, moveToActive && ptr != getPlayerPtr());
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…
Cancel
Save