From 0a85fae9b5f60767dc52357d5a5bea8facc4a81d Mon Sep 17 00:00:00 2001 From: Piotr Dziwinski Date: Fri, 10 Jul 2015 23:57:06 +0200 Subject: [PATCH] Fix crash in appearance menu --- src/physics/physics.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/physics/physics.cpp b/src/physics/physics.cpp index 9261df6b..8277a1fc 100644 --- a/src/physics/physics.cpp +++ b/src/physics/physics.cpp @@ -2523,6 +2523,9 @@ int CPhysics::ObjectAdapt(const Math::Vector &pos, const Math::Vector &angle) // iiPos = sphere center is the old position. // iPos = sphere center has the new position. + if (m_object->GetCrashSphereCount() < 1) + return 0; + auto firstCrashSphere = m_object->GetFirstCrashSphere(); Math::Vector iiPos = firstCrashSphere.sphere.pos; float iRad = firstCrashSphere.sphere.radius;