Merge pull request #78044 from RandomShaper/fix_node_prio_ignored

Fix node idle process priority being ignored
This commit is contained in:
Rémi Verschelde 2023-06-09 13:45:15 +02:00
commit 300748e52c
No known key found for this signature in database
GPG Key ID: C3336907360768E1
1 changed files with 10 additions and 5 deletions

View File

@ -905,11 +905,16 @@ void SceneTree::_process_group(ProcessGroup *p_group, bool p_physics) {
return;
}
bool &node_order_dirty = p_physics ? p_group->physics_node_order_dirty : p_group->node_order_dirty;
if (node_order_dirty) {
nodes.sort_custom<Node::ComparatorWithPhysicsPriority>();
node_order_dirty = false;
if (p_physics) {
if (p_group->physics_node_order_dirty) {
nodes.sort_custom<Node::ComparatorWithPhysicsPriority>();
p_group->physics_node_order_dirty = false;
}
} else {
if (p_group->node_order_dirty) {
nodes.sort_custom<Node::ComparatorWithPriority>();
p_group->node_order_dirty = false;
}
}
// Make a copy, so if nodes are added/removed from process, this does not break