From 39ac0cbb4ab37a373e4c67b8c2c18be74e45cde8 Mon Sep 17 00:00:00 2001 From: Evil Eye Date: Tue, 8 Dec 2020 17:47:25 +0100 Subject: [PATCH] Don't crash the game when placing a non-actor --- apps/openmw/mwworld/worldimp.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/apps/openmw/mwworld/worldimp.cpp b/apps/openmw/mwworld/worldimp.cpp index 9a2dd11819..d00fabb66d 100644 --- a/apps/openmw/mwworld/worldimp.cpp +++ b/apps/openmw/mwworld/worldimp.cpp @@ -1345,7 +1345,11 @@ namespace MWWorld moveObject(ptr, ptr.getCell(), pos.x(), pos.y(), pos.z()); if (force) // force physics to use the new position - mPhysics->getActor(ptr)->resetPosition(); + { + auto actor = mPhysics->getActor(ptr); + if(actor) + actor->resetPosition(); + } } void World::fixPosition()