diff options
author | Chaosus <chaosus89@gmail.com> | 2019-04-24 08:44:48 +0300 |
---|---|---|
committer | Chaosus <chaosus89@gmail.com> | 2019-04-24 09:14:45 +0300 |
commit | 21ca9f6c7c1bc2f8ae7b53da97d2ad8037573781 (patch) | |
tree | 048eebf05985bdb543a45c13ce70e19e11d82f50 /scene | |
parent | 80f91c9d3664ab8dd226a3708e36886381e4508b (diff) |
Disallow loopback connection in visual scripts and visual shaders
Diffstat (limited to 'scene')
-rw-r--r-- | scene/resources/visual_shader.cpp | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/scene/resources/visual_shader.cpp b/scene/resources/visual_shader.cpp index 4229147ba2..b8f21948c3 100644 --- a/scene/resources/visual_shader.cpp +++ b/scene/resources/visual_shader.cpp @@ -240,6 +240,9 @@ bool VisualShader::can_connect_nodes(Type p_type, int p_from_node, int p_from_po if (!g->nodes.has(p_from_node)) return false; + if (p_from_node == p_to_node) + return false; + if (p_from_port < 0 || p_from_port >= g->nodes[p_from_node].node->get_output_port_count()) return false; |