Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/source
diff options
context:
space:
mode:
authorBenoit Bolsee <benoit.bolsee@online.be>2014-10-11 14:14:02 +0400
committerBenoit Bolsee <benoit.bolsee@online.be>2014-10-11 14:17:31 +0400
commit04814476c08e9350c424619cd99ccb1149d65365 (patch)
treec31259e51e382ca9370449e8f63e7a2d98d32d13 /source
parent0a738280e1aae718f0916525ec5a18da6ea37f7a (diff)
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.
Diffstat (limited to 'source')
-rw-r--r--source/gameengine/Ketsji/KX_GameObject.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/source/gameengine/Ketsji/KX_GameObject.cpp b/source/gameengine/Ketsji/KX_GameObject.cpp
index c681e0842c4..dc246406a88 100644
--- a/source/gameengine/Ketsji/KX_GameObject.cpp
+++ b/source/gameengine/Ketsji/KX_GameObject.cpp
@@ -1587,9 +1587,10 @@ CListValue* KX_GameObject::GetChildrenRecursive()
KX_Scene* KX_GameObject::GetScene()
{
SG_Node* node = this->GetSGNode();
- KX_Scene* scene = static_cast<KX_Scene*>(node->GetSGClientInfo());
-
- return scene;
+ if (node == NULL)
+ // this happens for object in non active layers, rely on static scene then
+ return KX_GetActiveScene();
+ return static_cast<KX_Scene*>(node->GetSGClientInfo());
}
/* ---------------------------------------------------------------------