From 20f909219eca916450350300b30e445f3fce14af Mon Sep 17 00:00:00 2001 From: Yaohua Xiong Date: Wed, 4 Jan 2023 14:35:00 +0800 Subject: [PATCH] Remove side effect of the `handles` method --- editor/plugins/node_3d_editor_plugin.cpp | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/editor/plugins/node_3d_editor_plugin.cpp b/editor/plugins/node_3d_editor_plugin.cpp index 8e2b9b4bce9..94dda44feea 100644 --- a/editor/plugins/node_3d_editor_plugin.cpp +++ b/editor/plugins/node_3d_editor_plugin.cpp @@ -8670,13 +8670,7 @@ void Node3DEditorPlugin::edit(Object *p_object) { } bool Node3DEditorPlugin::handles(Object *p_object) const { - if (p_object->is_class("Node3D")) { - return true; - } else { - // This ensures that gizmos are cleared when selecting a non-Node3D node. - const_cast(this)->edit((Object *)nullptr); - return false; - } + return p_object->is_class("Node3D"); } Dictionary Node3DEditorPlugin::get_state() const {