summaryrefslogtreecommitdiff
path: root/scene/resources/visual_shader.cpp
diff options
context:
space:
mode:
authorYuri Roubinsky <chaosus89@gmail.com>2020-07-31 10:40:05 +0300
committerYuri Roubinsky <chaosus89@gmail.com>2020-07-31 10:40:05 +0300
commit4d5245661399cd1d72bc590acd2004f8a5cbeae8 (patch)
tree99bf9374e7cb69eb29ef748701ac19a92952d373 /scene/resources/visual_shader.cpp
parentbb6adf4ef92ca7fed5701e55e595ad35489cbc2c (diff)
Fix small reconnection bug in visual shader
Diffstat (limited to 'scene/resources/visual_shader.cpp')
-rw-r--r--scene/resources/visual_shader.cpp10
1 files changed, 9 insertions, 1 deletions
diff --git a/scene/resources/visual_shader.cpp b/scene/resources/visual_shader.cpp
index 8b84ce9e8c..e4851ad9f7 100644
--- a/scene/resources/visual_shader.cpp
+++ b/scene/resources/visual_shader.cpp
@@ -71,7 +71,15 @@ bool VisualShaderNode::is_output_port_connected(int p_port) const {
}
void VisualShaderNode::set_output_port_connected(int p_port, bool p_connected) {
- connected_output_ports[p_port] = p_connected;
+ if (p_connected) {
+ connected_output_ports[p_port] = true;
+ ++connected_output_count;
+ } else {
+ --connected_output_count;
+ if (connected_output_count == 0) {
+ connected_output_ports[p_port] = false;
+ }
+ }
}
bool VisualShaderNode::is_input_port_connected(int p_port) const {