summaryrefslogtreecommitdiffstats
path: root/editor/plugins/light_occluder_2d_editor_plugin.cpp
diff options
context:
space:
mode:
authorThaddeus Crews <repiteo@outlook.com>2024-06-09 15:21:41 -0500
committerThaddeus Crews <repiteo@outlook.com>2024-11-10 12:41:26 -0600
commit925b690c989dea13d0dfc06d2a7b1edc8de6b34f (patch)
tree444f95d5deffb18f2a1a91f6a06c0dd132d83600 /editor/plugins/light_occluder_2d_editor_plugin.cpp
parent0f5f3bc9546b46b2029fc8896dc859697f1eab97 (diff)
downloadredot-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.cpp4
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;