From 6627fe3f75217bd288bb3fb53dc7bb1dd20c3706 Mon Sep 17 00:00:00 2001 From: Benoit Bolsee Date: Sun, 15 Apr 2012 12:49:34 +0000 Subject: BGE bug #30555: crash in Replace Mesh when physics shape is triangle mesh and new mesh has no collision faces. The fix consists in keeping the previous physics shape, which is not quite correct, but the situation is unusual anyway. --- source/gameengine/Physics/Bullet/CcdPhysicsController.cpp | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'source/gameengine/Physics/Bullet') diff --git a/source/gameengine/Physics/Bullet/CcdPhysicsController.cpp b/source/gameengine/Physics/Bullet/CcdPhysicsController.cpp index 73ba187d732..9a85471fb9a 100644 --- a/source/gameengine/Physics/Bullet/CcdPhysicsController.cpp +++ b/source/gameengine/Physics/Bullet/CcdPhysicsController.cpp @@ -1918,6 +1918,10 @@ bool CcdShapeConstructionInfo::UpdateMesh(class KX_GameObject* gameobj, class RA } } + // This case happens when none of the polys are colliders + if (tot_bt_tris == 0 || tot_bt_verts == 0) + return false; + m_vertexArray.resize(tot_bt_verts*3); btScalar *bt= &m_vertexArray[0]; -- cgit v1.2.3