Skip to content

Commit

Permalink
UPBGE: Fix parenting.
Browse files Browse the repository at this point in the history
  • Loading branch information
panzergame committed Jun 1, 2018
1 parent fba7bd3 commit 4b6dca0
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions source/gameengine/Ketsji/KX_GameObject.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -346,7 +346,7 @@ void KX_GameObject::SetParent(KX_GameObject *obj, bool addToCompound, bool ghost
KX_Scene *scene = GetScene();

// Not already parented to same object, no parenting loop, not the object itself
if (m_sgNode->GetParent() == parentSgNode || !m_sgNode->IsAncessor(parentSgNode) || this != obj) {
if (m_sgNode->GetParent() == parentSgNode || m_sgNode->IsAncessor(parentSgNode) || this == obj) {
return;
}

Expand Down Expand Up @@ -408,8 +408,7 @@ void KX_GameObject::SetParent(KX_GameObject *obj, bool addToCompound, bool ghost

void KX_GameObject::RemoveParent()
{
// check on valid node in case a python controller holds a reference to a deleted object
if (m_sgNode->GetParent()) {
if (!m_sgNode->GetParent()) {
return;
}

Expand Down

0 comments on commit 4b6dca0

Please sign in to comment.