diff options
author | RĂ©mi Verschelde <rverschelde@gmail.com> | 2020-06-04 11:55:12 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-06-04 11:55:12 +0200 |
commit | 6a7b55805b01c40e6935c71c6795d9547357f9c3 (patch) | |
tree | 1c53b1787e9d95a31daaf4858ccbb66c80add32c /modules | |
parent | f66eed7d58db0a26e757d39557b29d4c22af2312 (diff) | |
parent | 5c48631509751191afc5a83e4c48075a90a38150 (diff) |
Merge pull request #39041 from swarnimarun/patch-1
Fix crashing of VisualScript due to function change
Diffstat (limited to 'modules')
-rw-r--r-- | modules/visual_script/visual_script_editor.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/modules/visual_script/visual_script_editor.cpp b/modules/visual_script/visual_script_editor.cpp index fea7d151df..b7ca3c882b 100644 --- a/modules/visual_script/visual_script_editor.cpp +++ b/modules/visual_script/visual_script_editor.cpp @@ -3216,6 +3216,7 @@ void VisualScriptEditor::_move_nodes_with_rescan(const StringName &p_func_from, { List<VisualScript::DataConnection> data_connections; script->get_data_connection_list(p_func_from, &data_connections); + int func_from_node_id = script->get_function_node_id(p_func_from); HashMap<int, Map<int, Pair<int, int>>> connections; @@ -3225,6 +3226,11 @@ void VisualScriptEditor::_move_nodes_with_rescan(const StringName &p_func_from, int out_p = E->get().from_port; int in_p = E->get().to_port; + // skip if the from_node is a function node + if (from == func_from_node_id) { + continue; + } + if (!connections.has(to)) { connections.set(to, Map<int, Pair<int, int>>()); } |