Fix "Invalid outputs" error when calling a void method from visual script

Fixes #11851
This commit is contained in:
Bojidar Marinov 2017-11-08 21:34:05 +02:00
parent 5fb359d8b1
commit 4045bc1059
No known key found for this signature in database
GPG Key ID: 4D546A8F1E091856
1 changed files with 2 additions and 0 deletions

View File

@ -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";