diff options
Diffstat (limited to 'scene/resources/visual_shader.cpp')
-rw-r--r-- | scene/resources/visual_shader.cpp | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/scene/resources/visual_shader.cpp b/scene/resources/visual_shader.cpp index b8d2003e68..84437faca0 100644 --- a/scene/resources/visual_shader.cpp +++ b/scene/resources/visual_shader.cpp @@ -65,20 +65,16 @@ bool VisualShaderNode::is_port_separator(int p_index) const { bool VisualShaderNode::is_output_port_connected(int p_port) const { if (connected_output_ports.has(p_port)) { - return connected_output_ports[p_port]; + return connected_output_ports[p_port] > 0; } return false; } void VisualShaderNode::set_output_port_connected(int p_port, bool p_connected) { if (p_connected) { - connected_output_ports[p_port] = true; - ++connected_output_count; + connected_output_ports[p_port]++; } else { - --connected_output_count; - if (connected_output_count == 0) { - connected_output_ports[p_port] = false; - } + connected_output_ports[p_port]--; } } |