Skip to content

Commit

Permalink
Fix "Invalid outputs" error when calling a void method from visual sc…
Browse files Browse the repository at this point in the history
…ript

Fixes godotengine#11851
  • Loading branch information
bojidar-bg committed Nov 8, 2017
1 parent 5fb359d commit 4045bc1
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions modules/visual_script/visual_script_func_nodes.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -858,6 +858,8 @@ class VisualScriptNodeInstanceFunctionCall : public VisualScriptNodeInstance {
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";
Expand Down

0 comments on commit 4045bc1

Please sign in to comment.