diff options
author | Yuri Roubinsky <chaosus89@gmail.com> | 2021-07-19 11:22:28 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-07-19 11:22:28 +0300 |
commit | e1547798d661e972e06860a33b92f7cbd6ec69d0 (patch) | |
tree | 932edaaad81f59162b7d21952247add5430b1d0a /modules/visual_script/visual_script_editor.cpp | |
parent | 95def293a6f72c97a473a6db0eb9e279e5c934a8 (diff) | |
parent | 88088f351ab093f489d4320cf8f3376de9481e59 (diff) | |
download | redot-engine-e1547798d661e972e06860a33b92f7cbd6ec69d0.tar.gz |
Merge pull request #50413 from Chaosus/vs_cleanup_warnings
Diffstat (limited to 'modules/visual_script/visual_script_editor.cpp')
-rw-r--r-- | modules/visual_script/visual_script_editor.cpp | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/modules/visual_script/visual_script_editor.cpp b/modules/visual_script/visual_script_editor.cpp index 8712bfa06b..57a631fb6a 100644 --- a/modules/visual_script/visual_script_editor.cpp +++ b/modules/visual_script/visual_script_editor.cpp @@ -2836,6 +2836,20 @@ void VisualScriptEditor::_graph_connected(const String &p_from, int p_from_slot, ERR_FAIL_COND(from_seq != to_seq); + // Checking to prevent warnings. + if (from_seq) { + if (script->has_sequence_connection(p_from.to_int(), from_port, p_to.to_int())) { + return; + } + } else if (script->has_data_connection(p_from.to_int(), from_port, p_to.to_int(), to_port)) { + return; + } + + // Preventing connection to itself. + if (p_from.to_int() == p_to.to_int()) { + return; + } + // Do all the checks here. StringName func; // This the func where we store the one the nodes at the end of the resolution on having multiple nodes. @@ -2989,7 +3003,7 @@ VisualScriptNode::TypeGuess VisualScriptEditor::_guess_output_type(int p_port_ac Ref<VisualScriptNode> node = script->get_node(p_port_action_node); - if (!node.is_valid()) { + if (!node.is_valid() || node->get_output_value_port_count() <= p_port_action_output) { return tg; } |