[Client] Ensure physics actor is valid in World::setOnGround()

Do the same in World::setInertialForce()
pull/593/head
David Cernat 3 years ago
parent e010c61167
commit 20e37204d0

@ -1715,9 +1715,13 @@ namespace MWWorld
void World::setInertialForce(const Ptr& ptr, const osg::Vec3f &force)
{
MWPhysics::Actor *actor = mPhysics->getActor(ptr);
if (actor != nullptr)
{
actor->setOnGround(false);
actor->setInertialForce(force);
}
}
/*
End of tes3mp addition
*/
@ -1731,8 +1735,12 @@ namespace MWWorld
void World::setOnGround(const Ptr& ptr, bool onGround)
{
MWPhysics::Actor* actor = mPhysics->getActor(ptr);
if (actor != nullptr)
{
actor->setOnGround(onGround);
}
}
/*
End of tes3mp addition
*/

Loading…
Cancel
Save