You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-21 14:57:09 +00:00
Core: Fix Callable.get_bound_arguments{,_count}() return incorrect data
This commit is contained in:
@@ -3055,11 +3055,12 @@ void Node::_duplicate_signals(const Node *p_original, Node *p_copy) const {
|
||||
if (copy && copytarget && E.callable.get_method() != StringName()) {
|
||||
Callable copy_callable = Callable(copytarget, E.callable.get_method());
|
||||
if (!copy->is_connected(E.signal.get_name(), copy_callable)) {
|
||||
int arg_count = E.callable.get_bound_arguments_count();
|
||||
if (arg_count > 0) {
|
||||
int unbound_arg_count = E.callable.get_unbound_arguments_count();
|
||||
if (unbound_arg_count > 0) {
|
||||
copy_callable = copy_callable.unbind(unbound_arg_count);
|
||||
}
|
||||
if (E.callable.get_bound_arguments_count() > 0) {
|
||||
copy_callable = copy_callable.bindv(E.callable.get_bound_arguments());
|
||||
} else if (arg_count < 0) {
|
||||
copy_callable = copy_callable.unbind(-arg_count);
|
||||
}
|
||||
copy->connect(E.signal.get_name(), copy_callable, E.flags);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user