diff options
| author | Ignacio Etcheverry | 2016-11-03 00:19:32 +0100 |
|---|---|---|
| committer | Ignacio Etcheverry | 2016-11-03 00:19:32 +0100 |
| commit | 305956bf707342547baabb7d3f237ebda385f9f4 (patch) | |
| tree | b266b537392b30aaf9075c5af5a93e4d7016ff18 /scene/main/node.cpp | |
| parent | c67e3a485dedae96b82c3356d5f45ab0509d7759 (diff) | |
| download | godot-305956bf707342547baabb7d3f237ebda385f9f4.tar.gz godot-305956bf707342547baabb7d3f237ebda385f9f4.tar.zst godot-305956bf707342547baabb7d3f237ebda385f9f4.zip | |
Keep groups when replacing nodes
Diffstat (limited to '')
| -rw-r--r-- | scene/main/node.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/scene/main/node.cpp b/scene/main/node.cpp index 6e33dcb4c..f4fb48682 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); |
