Merge pull request #52810 from Chaosus/vs_fix_gotoline

Fix incorrect call of `_center_on_node` in VisualScript editor
This commit is contained in:
Rémi Verschelde 2021-09-18 12:40:34 +02:00 committed by GitHub
commit 22b225395c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 9 deletions

View File

@ -2546,16 +2546,11 @@ void VisualScriptEditor::goto_line(int p_line, bool p_with_error) {
error_line = p_line;
}
List<StringName> 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.
}
}