From dc2ea39f242979f69be3469bea8ef2467ab98b34 Mon Sep 17 00:00:00 2001 From: Ignacio Etcheverry Date: Thu, 9 Jun 2016 16:24:12 +0200 Subject: Preserve signal connections when replacing the target node --- scene/main/node.cpp | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'scene/main/node.cpp') diff --git a/scene/main/node.cpp b/scene/main/node.cpp index f8af83e23..cfc7116d1 100644 --- a/scene/main/node.cpp +++ b/scene/main/node.cpp @@ -1770,6 +1770,8 @@ void Node::replace_by(Node* p_node,bool p_keep_data) { } } + _replace_connections_target(p_node); + if (data.owner) { for(int i=0;i cl; + get_signals_connected_to_this(&cl); + + for(List::Element *E=cl.front();E;E=E->next()) { + + Connection &c=E->get(); + + c.source->disconnect(c.signal,this,c.method); + c.source->connect(c.signal,p_new_target,c.method,c.binds,c.flags); + } +} + Vector Node::make_binds(VARIANT_ARG_DECLARE) { -- cgit v1.2.3-70-g09d2