diff options
author | RĂ©mi Verschelde <rverschelde@gmail.com> | 2020-11-05 00:46:28 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-11-05 00:46:28 +0100 |
commit | c35517f07eb0f0f71d4c5aa8d40420aa0f8ad6e3 (patch) | |
tree | c880ba5f936454fe9632198b17c7d114c1ed9913 /modules/gdscript | |
parent | 8e13b93bf78e4440e2012cec4940b8e3318daac1 (diff) | |
parent | c37f6332164380e626ba2f2d6caf056b2e8222bd (diff) |
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()
Diffstat (limited to 'modules/gdscript')
-rw-r--r-- | modules/gdscript/gdscript_function.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/modules/gdscript/gdscript_function.cpp b/modules/gdscript/gdscript_function.cpp index e59f99fc56..1da0e7b4c6 100644 --- a/modules/gdscript/gdscript_function.cpp +++ b/modules/gdscript/gdscript_function.cpp @@ -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; |