From c37f6332164380e626ba2f2d6caf056b2e8222bd Mon Sep 17 00:00:00 2001 From: Umang Kalra Date: Sat, 17 Oct 2020 12:30:29 +0530 Subject: Fixes the misleading error message for call_recursive method for TreeItems --- modules/gdscript/gdscript_function.cpp | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'modules/gdscript') 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; -- cgit v1.2.3