summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIgnacio Etcheverry <neikeq@users.noreply.github.com>2016-11-06 02:00:21 +0100
committerGitHub <noreply@github.com>2016-11-06 02:00:21 +0100
commitd76f622c9261a394dae9542d2bc57bbe3d86e446 (patch)
tree911e084740fb53bfb71b40f82711c7cebe2009b1
parent79e8c7fc0d15ab432f017e9b40b2122e89610d40 (diff)
parent305956bf707342547baabb7d3f237ebda385f9f4 (diff)
Merge pull request #7022 from neikeq/pr-issue-7013
Keep groups when replacing nodes
-rw-r--r--scene/main/node.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/scene/main/node.cpp b/scene/main/node.cpp
index 6e33dcb4c9..f4fb48682c 100644
--- a/scene/main/node.cpp
+++ b/scene/main/node.cpp
@@ -2485,6 +2485,12 @@ void Node::replace_by(Node* p_node,bool p_keep_data) {
rd.name=E->get().name;
rd.value=get(rd.name);
}
+
+ List<GroupInfo> groups;
+ get_groups(&groups);
+
+ for(List<GroupInfo>::Element *E=groups.front();E;E=E->next())
+ p_node->add_to_group(E->get().name, E->get().persistent);
}
_replace_connections_target(p_node);