diff options
author | Thaddeus Crews <repiteo@outlook.com> | 2024-06-09 15:21:41 -0500 |
---|---|---|
committer | Thaddeus Crews <repiteo@outlook.com> | 2024-11-10 12:41:26 -0600 |
commit | 925b690c989dea13d0dfc06d2a7b1edc8de6b34f (patch) | |
tree | 444f95d5deffb18f2a1a91f6a06c0dd132d83600 /editor/plugins/light_occluder_2d_editor_plugin.cpp | |
parent | 0f5f3bc9546b46b2029fc8896dc859697f1eab97 (diff) | |
download | redot-engine-925b690c989dea13d0dfc06d2a7b1edc8de6b34f.tar.gz |
Core: Integrate `Ref::instantiate` where possible
Diffstat (limited to 'editor/plugins/light_occluder_2d_editor_plugin.cpp')
-rw-r--r-- | editor/plugins/light_occluder_2d_editor_plugin.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/editor/plugins/light_occluder_2d_editor_plugin.cpp b/editor/plugins/light_occluder_2d_editor_plugin.cpp index 429add4540..e3b59f9bfb 100644 --- a/editor/plugins/light_occluder_2d_editor_plugin.cpp +++ b/editor/plugins/light_occluder_2d_editor_plugin.cpp @@ -35,8 +35,8 @@ Ref<OccluderPolygon2D> LightOccluder2DEditor::_ensure_occluder() const { Ref<OccluderPolygon2D> occluder = node->get_occluder_polygon(); - if (!occluder.is_valid()) { - occluder = Ref<OccluderPolygon2D>(memnew(OccluderPolygon2D)); + if (occluder.is_null()) { + occluder.instantiate(); node->set_occluder_polygon(occluder); } return occluder; |