Commit ee19b6b5 authored by cutealien's avatar cutealien

Bugfix: IGUIElement::addChild now prevents setting an element as it's own...

Bugfix: IGUIElement::addChild now prevents setting an element as it's own child (fixes for example a crash in the GUI-editor).


git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@4694 dfc29bdd-3216-0410-991c-e03cc46cb475
parent d6975872
-------------------------- --------------------------
Changes in 1.9 (not yet released) Changes in 1.9 (not yet released)
- Bugfix: IGUIElement::addChild now prevents setting an element as it's own child.
- Bugfix: getFont for xml-fonts now also works for fonts inside archives (thx @Neirdan for bugreport) - Bugfix: getFont for xml-fonts now also works for fonts inside archives (thx @Neirdan for bugreport)
- Added function irr::core::mergeFilename - Added function irr::core::mergeFilename
- Add ISceneNodeAnimator::setStartTime/getStartTime to allow resetting movement animators. - Add ISceneNodeAnimator::setStartTime/getStartTime to allow resetting movement animators.
......
...@@ -278,9 +278,9 @@ public: ...@@ -278,9 +278,9 @@ public:
//! Adds a GUI element as new child of this element. //! Adds a GUI element as new child of this element.
virtual void addChild(IGUIElement* child) virtual void addChild(IGUIElement* child)
{ {
addChildToEnd(child); if ( child && child != this )
if (child)
{ {
addChildToEnd(child);
child->updateAbsolutePosition(); child->updateAbsolutePosition();
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment