summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIgnacio Etcheverry <ignalfonsore@gmail.com>2016-11-03 00:19:32 +0100
committerIgnacio Etcheverry <ignalfonsore@gmail.com>2016-11-03 00:19:32 +0100
commit305956bf707342547baabb7d3f237ebda385f9f4 (patch)
treeb266b537392b30aaf9075c5af5a93e4d7016ff18
parentc67e3a485dedae96b82c3356d5f45ab0509d7759 (diff)
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);