From e36117f557326d32f1da65394432596304e3d44e Mon Sep 17 00:00:00 2001 From: jsjtxietian Date: Tue, 26 Sep 2023 17:57:45 +0800 Subject: [PATCH] Fix can not set process priority of node if not any process is processing --- scene/main/node.cpp | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/scene/main/node.cpp b/scene/main/node.cpp index d8a50c4313a..5a107188fa3 100644 --- a/scene/main/node.cpp +++ b/scene/main/node.cpp @@ -968,7 +968,11 @@ void Node::set_process_priority(int p_priority) { if (_is_any_processing()) { _remove_from_process_thread_group(); - data.process_priority = p_priority; + } + + data.process_priority = p_priority; + + if (_is_any_processing()) { _add_to_process_thread_group(); } } @@ -990,7 +994,11 @@ void Node::set_physics_process_priority(int p_priority) { if (_is_any_processing()) { _remove_from_process_thread_group(); - data.physics_process_priority = p_priority; + } + + data.physics_process_priority = p_priority; + + if (_is_any_processing()) { _add_to_process_thread_group(); } }