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
diff options
context:
space:
mode:
authorDalai Felinto <dfelinto@gmail.com>2010-04-01 02:49:59 +0400
committerDalai Felinto <dfelinto@gmail.com>2010-04-01 02:49:59 +0400
commitea0e0b3f15852a062a0b6578f729d768e848f7d1 (patch)
tree6b0462d4d1e727cc598980d686a44086f14b5e75 /source/gameengine
parentc19725b2667cfcec64135901ccb40b3c9ec37e00 (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.cpp3
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();