From dfae75d0c5191133ec9e9f49d95077aec7ff7f8c Mon Sep 17 00:00:00 2001 From: Yuri Roubinsky Date: Sat, 18 Sep 2021 10:39:22 +0300 Subject: [PATCH] Fix incorrect call of `_center_on_node` in VisualScript editor --- modules/visual_script/visual_script_editor.cpp | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/modules/visual_script/visual_script_editor.cpp b/modules/visual_script/visual_script_editor.cpp index c2fa3cbd9d2..0a6bcedf314 100644 --- a/modules/visual_script/visual_script_editor.cpp +++ b/modules/visual_script/visual_script_editor.cpp @@ -2546,16 +2546,11 @@ void VisualScriptEditor::goto_line(int p_line, bool p_with_error) { error_line = p_line; } - List functions; - script->get_function_list(&functions); - for (const StringName &E : functions) { - if (script->has_node(p_line)) { - _update_graph(); - _update_members(); + if (script->has_node(p_line)) { + _update_graph(); + _update_members(); - call_deferred(SNAME("call_deferred"), "_center_on_node", E, p_line); //editor might be just created and size might not exist yet - return; - } + call_deferred(SNAME("call_deferred"), "_center_on_node", p_line); // The editor might be just created and size might not exist yet. } }