Added protection

Former-commit-id: 1e5f0c1421fda868a3a1ef59a92cc0a2ca2e5c47
This commit is contained in:
Lynix 2013-03-12 23:35:59 +01:00
parent d695bb02e8
commit c67b0d709f
1 changed files with 8 additions and 0 deletions

View File

@ -356,6 +356,14 @@ void NzNode::SetName(const NzString& name)
void NzNode::SetParent(const NzNode* node, bool keepDerived) 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) if (m_parent == node)
return; return;