fix for segfault when the replace mesh actuator references a mesh that has no object in the current scene.

This commit is contained in:
Campbell Barton
2009-02-24 09:49:28 +00:00
parent 6c7c38a4e4
commit 33aee345ed

View File

@@ -1014,6 +1014,12 @@ void KX_Scene::ReplaceMesh(class CValue* obj,void* meshobj)
blendmesh->dvert!=NULL; // mesh has vertex group
bool releaseParent = true;
if (oldblendobj==NULL) {
std::cout << "warning: ReplaceMesh() new mesh is not used in an object from the current scene, you will get incorrect behavior" << std::endl;
bHasShapeKey= bHasDvert= bHasArmature= false;
}
if (bHasShapeKey)
{
BL_ShapeDeformer* shapeDeformer;