Fix editable children errors when packing scene tree at runtime

When packing a scene node which is not the root, errors where caused
by internal checks in is_editable_instance method.

This check can be safely made outside instead.

(cherry picked from commit 2f6cf3b8a8)
This commit is contained in:
PouleyKetchoupp 2021-10-05 14:49:50 -07:00 committed by Rémi Verschelde
parent 732dfddc20
commit 00d4a30b05
No known key found for this signature in database
GPG key ID: C3336907360768E1

View file

@ -386,7 +386,7 @@ Error SceneState::_parse_node(Node *p_owner, Node *p_node, int p_parent_idx, Map
editable_instances.push_back(p_owner->get_path_to(p_node));
// Node is the root of an editable instance.
is_editable_instance = true;
} else if (p_node->get_owner() && p_node->get_owner() != p_owner && p_owner->is_editable_instance(p_node->get_owner())) {
} else if (p_node->get_owner() && p_owner->is_a_parent_of(p_node->get_owner()) && p_owner->is_editable_instance(p_node->get_owner())) {
// Node is part of an editable instance.
is_editable_instance = true;
}