Fix issue adding drawable to node that is not yet attached to a scene

This commit is contained in:
Georg Hagen
2024-07-03 15:10:52 +02:00
parent 9aa49ce35a
commit 9e95285173

View File

@@ -110,7 +110,7 @@ namespace OpenVulkano::Scene
{ {
if (this->parent && parent) throw std::runtime_error("Node already has a parent! Nodes must not be used multiple times!"); if (this->parent && parent) throw std::runtime_error("Node already has a parent! Nodes must not be used multiple times!");
this->parent = parent; this->parent = parent;
if(parent && parent != this) this->scene = parent->scene; if(parent && parent != this) SetScene(parent->scene);
if (!parent) SetScene(nullptr); if (!parent) SetScene(nullptr);
} }