From 20e37204d0e937660461eadf83b41db5de1de9d2 Mon Sep 17 00:00:00 2001 From: David Cernat Date: Sun, 17 Oct 2021 18:20:52 +0200 Subject: [PATCH] [Client] Ensure physics actor is valid in World::setOnGround() Do the same in World::setInertialForce() --- apps/openmw/mwworld/worldimp.cpp | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/apps/openmw/mwworld/worldimp.cpp b/apps/openmw/mwworld/worldimp.cpp index dabd7719b..99fab075d 100644 --- a/apps/openmw/mwworld/worldimp.cpp +++ b/apps/openmw/mwworld/worldimp.cpp @@ -1715,8 +1715,12 @@ namespace MWWorld void World::setInertialForce(const Ptr& ptr, const osg::Vec3f &force) { MWPhysics::Actor *actor = mPhysics->getActor(ptr); - actor->setOnGround(false); - actor->setInertialForce(force); + + if (actor != nullptr) + { + actor->setOnGround(false); + actor->setInertialForce(force); + } } /* End of tes3mp addition @@ -1731,7 +1735,11 @@ namespace MWWorld void World::setOnGround(const Ptr& ptr, bool onGround) { MWPhysics::Actor* actor = mPhysics->getActor(ptr); - actor->setOnGround(onGround); + + if (actor != nullptr) + { + actor->setOnGround(onGround); + } } /* End of tes3mp addition