Ported: Mark node groups as dirty for every children if parent is moved - YuriSizov

6d53c60bf7
This commit is contained in:
Relintai 2022-08-07 15:32:28 +02:00
parent c81f43e454
commit 3b84a64a36
2 changed files with 15 additions and 5 deletions

View File

@ -433,11 +433,8 @@ void Node::move_child(Node *p_child, int p_pos) {
for (int i = motion_from; i <= motion_to; i++) {
data.children[i]->notification(NOTIFICATION_MOVED_IN_PARENT);
}
for (const Map<StringName, GroupData>::Element *E = p_child->data.grouped.front(); E; E = E->next()) {
if (E->get().group) {
E->get().group->changed = true;
}
}
p_child->_propagate_groups_dirty();
data.blocked--;
}
@ -548,6 +545,18 @@ void Node::_propagate_pause_owner(Node *p_owner) {
}
}
void Node::_propagate_groups_dirty() {
for (const Map<StringName, GroupData>::Element *E = data.grouped.front(); E; E = E->next()) {
if (E->get().group) {
E->get().group->changed = true;
}
}
for (int i = 0; i < data.children.size(); i++) {
data.children[i]->_propagate_groups_dirty();
}
}
void Node::set_network_master(int p_peer_id, bool p_recursive) {
data.network_master = p_peer_id;

View File

@ -197,6 +197,7 @@ private:
void _propagate_physics_interpolation_reset_requested();
void _print_stray_nodes();
void _propagate_pause_owner(Node *p_owner);
void _propagate_groups_dirty();
Array _get_node_and_resource(const NodePath &p_path);
void _duplicate_signals(const Node *p_original, Node *p_copy) const;