Skip to content

Commit

Permalink
Merge pull request #78044 from RandomShaper/fix_node_prio_ignored
Browse files Browse the repository at this point in the history
Fix node idle process priority being ignored
  • Loading branch information
akien-mga committed Jun 9, 2023
2 parents b6bb244 + 8bbc713 commit 300748e
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions scene/main/scene_tree.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 300748e

Please sign in to comment.