Fix issue adding drawable to node that is not yet attached to a scene
This commit is contained in:
@@ -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);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user