From e30dfb13d3bb1771ebd5b963e1d07fa6ee27a503 Mon Sep 17 00:00:00 2001 From: Aussiemon Date: Wed, 14 Dec 2016 19:05:30 -0700 Subject: [PATCH] Added check before attempting to remove actor's collision object from world --- apps/openmw/mwphysics/actor.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/apps/openmw/mwphysics/actor.cpp b/apps/openmw/mwphysics/actor.cpp index 61022da28..dacffe22c 100644 --- a/apps/openmw/mwphysics/actor.cpp +++ b/apps/openmw/mwphysics/actor.cpp @@ -72,7 +72,10 @@ void Actor::enableCollisionBody(bool collision) void Actor::updateCollisionMask() { - mCollisionWorld->removeCollisionObject(mCollisionObject.get()); + if (mCollisionObject.get()->getWorldArrayIndex() >= 0) + { + mCollisionWorld->removeCollisionObject(mCollisionObject.get()); + } int collisionMask = CollisionType_World | CollisionType_HeightMap; if (mExternalCollisionMode) collisionMask |= CollisionType_Actor | CollisionType_Projectile | CollisionType_Door;