diff options
author | jsjtxietian <jsjtxietian@outlook.com> | 2023-09-26 17:57:45 +0800 |
---|---|---|
committer | jsjtxietian <jsjtxietian@outlook.com> | 2023-09-26 19:29:25 +0800 |
commit | e36117f557326d32f1da65394432596304e3d44e (patch) | |
tree | 5764fbd70e09fa2648a9d2f7b32272f709ed73a5 | |
parent | 43b9e89a07bb0926fb66bddbf98981d25a5cccee (diff) | |
download | redot-engine-e36117f557326d32f1da65394432596304e3d44e.tar.gz |
Fix can not set process priority of node if not any process is processing
-rw-r--r-- | scene/main/node.cpp | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/scene/main/node.cpp b/scene/main/node.cpp index d8a50c4313..5a107188fa 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(); } } |