From 925b690c989dea13d0dfc06d2a7b1edc8de6b34f Mon Sep 17 00:00:00 2001 From: Thaddeus Crews <repiteo@outlook.com> Date: Sun, 9 Jun 2024 15:21:41 -0500 Subject: Core: Integrate `Ref::instantiate` where possible --- editor/plugins/navigation_polygon_editor_plugin.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'editor/plugins/navigation_polygon_editor_plugin.cpp') diff --git a/editor/plugins/navigation_polygon_editor_plugin.cpp b/editor/plugins/navigation_polygon_editor_plugin.cpp index 3c71040408..c11a7cf20e 100644 --- a/editor/plugins/navigation_polygon_editor_plugin.cpp +++ b/editor/plugins/navigation_polygon_editor_plugin.cpp @@ -38,8 +38,8 @@ Ref<NavigationPolygon> NavigationPolygonEditor::_ensure_navpoly() const { Ref<NavigationPolygon> navpoly = node->get_navigation_polygon(); - if (!navpoly.is_valid()) { - navpoly = Ref<NavigationPolygon>(memnew(NavigationPolygon)); + if (navpoly.is_null()) { + navpoly.instantiate(); node->set_navigation_polygon(navpoly); } return navpoly; -- cgit v1.2.3