forked from bartvdbraak/blender
Fix another crash with Navigation mesh.
Navigation mesh object need to access the current scene at creation time. This can be at scene start or when an object is instantiated from an inactive layer. The method of getting the scene differs in these cases. This fix handles both.
This commit is contained in:
parent
0a738280e1
commit
04814476c0
@ -1587,9 +1587,10 @@ CListValue* KX_GameObject::GetChildrenRecursive()
|
|||||||
KX_Scene* KX_GameObject::GetScene()
|
KX_Scene* KX_GameObject::GetScene()
|
||||||
{
|
{
|
||||||
SG_Node* node = this->GetSGNode();
|
SG_Node* node = this->GetSGNode();
|
||||||
KX_Scene* scene = static_cast<KX_Scene*>(node->GetSGClientInfo());
|
if (node == NULL)
|
||||||
|
// this happens for object in non active layers, rely on static scene then
|
||||||
return scene;
|
return KX_GetActiveScene();
|
||||||
|
return static_cast<KX_Scene*>(node->GetSGClientInfo());
|
||||||
}
|
}
|
||||||
|
|
||||||
/* ---------------------------------------------------------------------
|
/* ---------------------------------------------------------------------
|
||||||
|
Loading…
Reference in New Issue
Block a user