1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-09 12:50:35 +00:00

Merge pull request #19853 from khairul169/duplicate_bug

Fix duplicate method on instanced node generates duplicated children.
This commit is contained in:
Max Hilbrunner
2018-07-03 18:48:45 +02:00
committed by GitHub

View File

@@ -1895,7 +1895,7 @@ Node *Node::_duplicate(int p_flags, Map<const Node *, Node *> *r_duplimap) const
// Skip nodes not really belonging to the instanced hierarchy; they'll be processed normally later
// but remember non-instanced nodes that are hidden below instanced ones
if (descendant->data.owner != this) {
if (descendant->get_parent() && descendant->get_parent() != this && descendant->get_parent()->data.owner == this)
if (descendant->get_parent() && descendant->get_parent() != this && descendant->get_parent()->data.owner == this && descendant->data.owner != descendant->get_parent())
hidden_roots.push_back(descendant);
continue;
}