summaryrefslogtreecommitdiffstats
path: root/scene/main/node.cpp
diff options
context:
space:
mode:
authorGeorge L. Albany <Megacake1234@gmail.com>2024-11-12 20:29:24 +0000
committerGitHub <noreply@github.com>2024-11-12 20:29:24 +0000
commitac1a49725fc038ae11ef9060fecb2b0f9c6333b2 (patch)
treec7341bd56c977259578b127886c9a88eeef11820 /scene/main/node.cpp
parent5094c2a5f7d506b0e685120f14d1df42e1e9d495 (diff)
parent3a73c6ebd18bff0fa125be58d3ac9c7a63bab61d (diff)
downloadredot-engine-ac1a49725fc038ae11ef9060fecb2b0f9c6333b2.tar.gz
Merge pull request #855 from Spartan322/merge/cb411fa
Merge commit godotengine/godot@cb411fa
Diffstat (limited to 'scene/main/node.cpp')
-rw-r--r--scene/main/node.cpp9
1 files changed, 5 insertions, 4 deletions
diff --git a/scene/main/node.cpp b/scene/main/node.cpp
index c4abae298a..6076e975f9 100644
--- a/scene/main/node.cpp
+++ b/scene/main/node.cpp
@@ -3111,11 +3111,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);
}