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.

This commit is contained in:
Benoit Bolsee 2012-04-15 12:49:34 +00:00
parent 5f0c43d2c2
commit 6627fe3f75
1 changed files with 4 additions and 0 deletions

View File

@ -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];