Merge pull request #42724 from theoway/error_message_fix_call_recursive

Fixes the misleading message when a non-existing function name is passed to TreeItem.call_recursive()
This commit is contained in:
Rémi Verschelde 2020-11-05 00:46:28 +01:00 committed by GitHub
commit c35517f07e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1093,6 +1093,13 @@ Variant GDScriptFunction::call(GDScriptInstance *p_instance, const Variant **p_a
OPCODE_BREAK;
}
}
} else if (methodstr == "call_recursive" && basestr == "TreeItem") {
if (argc >= 1) {
methodstr = String(*argptrs[0]) + " (via TreeItem.call_recursive)";
if (err.error == Callable::CallError::CALL_ERROR_INVALID_ARGUMENT) {
err.argument += 1;
}
}
}
err_text = _get_call_error(err, "function '" + methodstr + "' in base '" + basestr + "'", (const Variant **)argptrs);
OPCODE_BREAK;