mirror of
https://github.com/godotengine/godot.git
synced 2024-11-24 21:22:48 +00:00
Merge pull request #91677 from KoBeWi/duplication_went_wrong
Fix crash when adding a child while duplicating a node
This commit is contained in:
commit
24ce82727f
@ -2930,8 +2930,10 @@ void Node::_duplicate_properties_node(const Node *p_root, const Node *p_original
|
||||
}
|
||||
}
|
||||
|
||||
for (int i = 0; i < p_copy->get_child_count(); i++) {
|
||||
_duplicate_properties_node(p_root, p_original->get_child(i), p_copy->get_child(i));
|
||||
for (int i = 0; i < p_original->get_child_count(); i++) {
|
||||
Node *copy_child = p_copy->get_child(i);
|
||||
ERR_FAIL_NULL_MSG(copy_child, "Child node disappeared while duplicating.");
|
||||
_duplicate_properties_node(p_root, p_original->get_child(i), copy_child);
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user