Added protection
Former-commit-id: 1e5f0c1421fda868a3a1ef59a92cc0a2ca2e5c47
This commit is contained in:
parent
d695bb02e8
commit
c67b0d709f
|
|
@ -356,6 +356,14 @@ void NzNode::SetName(const NzString& name)
|
|||
|
||||
void NzNode::SetParent(const NzNode* node, bool keepDerived)
|
||||
{
|
||||
#if NAZARA_UTILITY_SAFE
|
||||
if (node == this)
|
||||
{
|
||||
NazaraError("A node can be it's own parent");
|
||||
return;
|
||||
}
|
||||
#endif
|
||||
|
||||
if (m_parent == node)
|
||||
return;
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue