diff options
author | RĂ©mi Verschelde <rverschelde@gmail.com> | 2017-11-09 09:55:50 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-11-09 09:55:50 +0100 |
commit | 5f805de6cbfe8a3afc8c5453317fc843b7228c73 (patch) | |
tree | b2012d96c9caf0c3c72352c3cc4d8faf593d3aed | |
parent | 355c8fd968fbedcc52bcf57bf33bf3536cbfbdeb (diff) | |
parent | 4045bc1059ede7b408e62bbc88381afea4d430e0 (diff) |
Merge pull request #12751 from bojidar-bg/11851-invalid-returns-count
Fix "Invalid outputs" error when calling a void method from visual script
-rw-r--r-- | modules/visual_script/visual_script_func_nodes.cpp | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/modules/visual_script/visual_script_func_nodes.cpp b/modules/visual_script/visual_script_func_nodes.cpp index 8d73de9889..a5dc6ffc13 100644 --- a/modules/visual_script/visual_script_func_nodes.cpp +++ b/modules/visual_script/visual_script_func_nodes.cpp @@ -858,6 +858,8 @@ public: if (call_mode == VisualScriptFunctionCall::CALL_MODE_INSTANCE) { if (returns >= 2) { *p_outputs[1] = v.call(function, p_inputs + 1, input_args, r_error); + } else if (returns == 1) { + v.call(function, p_inputs + 1, input_args, r_error); } else { r_error.error = Variant::CallError::CALL_ERROR_INVALID_METHOD; r_error_str = "Invalid returns count for call_mode == CALL_MODE_INSTANCE"; |