Fix issue when removing drawable from scene by setting it's scene to nullptr
This commit is contained in:
@@ -132,12 +132,15 @@ namespace OpenVulkano::Scene
|
||||
node->SetScene(scene);
|
||||
}
|
||||
for (auto& drawable : drawables)
|
||||
{
|
||||
if (scene)
|
||||
{
|
||||
Scene* drawableScene = drawable->GetScene();
|
||||
if(drawableScene && drawableScene != scene) [[unlikely]]
|
||||
{
|
||||
throw std::runtime_error("Drawable is already associated with a scene! Creating copy.");
|
||||
}
|
||||
}
|
||||
drawable->SetScene(scene);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user