1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-04 12:00:25 +00:00

Properly report Callable bound arguments

Fixes #63213
Adds a function: Callable::get_amount_of_arguments_bound() to query this in callables. Exposed to the engine API.
This commit is contained in:
Juan Linietsky
2023-01-06 15:37:53 +01:00
parent b14f7aa9f9
commit 0e0ca01bce
7 changed files with 32 additions and 2 deletions

View File

@@ -1055,7 +1055,7 @@ Error Object::emit_signalp(const StringName &p_name, const Variant **p_args, int
if (ce.error == Callable::CallError::CALL_ERROR_INVALID_METHOD && !ClassDB::class_exists(target->get_class_name())) {
//most likely object is not initialized yet, do not throw error.
} else {
ERR_PRINT("Error calling from signal '" + String(p_name) + "' to callable: " + Variant::get_callable_error_text(c.callable, args, argc, ce) + ".");
ERR_PRINT("Error calling from signal '" + String(p_name) + "' to callable: " + Variant::get_callable_error_text(c.callable, args, argc + c.callable.get_bound_arguments_count(), ce) + ".");
err = ERR_METHOD_NOT_FOUND;
}
}