diff options
author | Dalai Felinto <dfelinto@gmail.com> | 2010-04-01 02:49:59 +0400 |
---|---|---|
committer | Dalai Felinto <dfelinto@gmail.com> | 2010-04-01 02:49:59 +0400 |
commit | ea0e0b3f15852a062a0b6578f729d768e848f7d1 (patch) | |
tree | 6b0462d4d1e727cc598980d686a44086f14b5e75 /source/gameengine | |
parent | c19725b2667cfcec64135901ccb40b3c9ec37e00 (diff) |
BGE fix: Parenting the object to itself crashes BGE + stubs update
it may happen if you start doing exec, setParent, ... in Python
not a big deal, but to crash Blender is always bad
Diffstat (limited to 'source/gameengine')
-rw-r--r-- | source/gameengine/Ketsji/KX_GameObject.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/source/gameengine/Ketsji/KX_GameObject.cpp b/source/gameengine/Ketsji/KX_GameObject.cpp index 9cb7e802235..637b874ef5e 100644 --- a/source/gameengine/Ketsji/KX_GameObject.cpp +++ b/source/gameengine/Ketsji/KX_GameObject.cpp @@ -238,7 +238,8 @@ void KX_GameObject::SetParent(KX_Scene *scene, KX_GameObject* obj, bool addToCom GetSGNode() && // object is not zombi obj->GetSGNode() && // object is not zombi GetSGNode()->GetSGParent() != obj->GetSGNode() && // not already parented to same object - !GetSGNode()->IsAncessor(obj->GetSGNode())) // no parenting loop + !GetSGNode()->IsAncessor(obj->GetSGNode()) && // no parenting loop + this != obj) // not the object itself { // Make sure the objects have some scale MT_Vector3 scale1 = NodeGetWorldScaling(); |