diff options
author | Michael Alexsander Silva Dias <michaelalexsander@protonmail.com> | 2019-06-10 19:35:22 -0300 |
---|---|---|
committer | Michael Alexsander Silva Dias <michaelalexsander@protonmail.com> | 2019-06-10 19:37:56 -0300 |
commit | b3010d9734e43dd7d7f3214880fe0139e6da7e7f (patch) | |
tree | c1efe7d181bbe0a38b8796525641263d6e5af34d /editor/plugins/script_text_editor.cpp | |
parent | 629bc10d80414570d18e0d918e59a116cb68dced (diff) | |
download | redot-engine-b3010d9734e43dd7d7f3214880fe0139e6da7e7f.tar.gz |
Fix connection info still appearing on scripts if the node source is deleted
Diffstat (limited to 'editor/plugins/script_text_editor.cpp')
-rw-r--r-- | editor/plugins/script_text_editor.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/editor/plugins/script_text_editor.cpp b/editor/plugins/script_text_editor.cpp index 1fe4ac1372..85913e742d 100644 --- a/editor/plugins/script_text_editor.cpp +++ b/editor/plugins/script_text_editor.cpp @@ -867,6 +867,12 @@ void ScriptTextEditor::_update_connected_methods() { continue; } + // As deleted nodes are still accessible via the undo/redo system, check if they're still on the tree. + Node *source = Object::cast_to<Node>(connection.source); + if (source && !source->is_inside_tree()) { + continue; + } + int line = script->get_language()->find_function(connection.method, text_edit->get_text()); if (line < 0) { missing_connections.push_back(connection); |