summaryrefslogtreecommitdiff
path: root/scene
diff options
context:
space:
mode:
authorRĂ©mi Verschelde <rverschelde@gmail.com>2019-11-22 09:02:40 +0100
committerGitHub <noreply@github.com>2019-11-22 09:02:40 +0100
commitfd6394e217209b7f5d87128ad3b496f079d19490 (patch)
treec9fb5dd97bfae6196af4830034c2dbc3633f5d16 /scene
parent2ea0d79073849e3ecd27d382588955c4fc886c3d (diff)
parenta7df198c942c3c325c6ec7ac189b1d19517395c2 (diff)
Merge pull request #33798 from capnm/capnm-fix-33749
Setting the node process priority should not trigger an error
Diffstat (limited to 'scene')
-rw-r--r--scene/main/node.cpp17
1 files changed, 12 insertions, 5 deletions
diff --git a/scene/main/node.cpp b/scene/main/node.cpp
index 2a2a6bb41d..616ccc00cb 100644
--- a/scene/main/node.cpp
+++ b/scene/main/node.cpp
@@ -835,19 +835,26 @@ bool Node::is_processing_internal() const {
void Node::set_process_priority(int p_priority) {
data.process_priority = p_priority;
- ERR_FAIL_COND(!data.tree);
+ // Make sure we are in SceneTree.
+ if (data.tree == NULL) {
+ return;
+ }
- if (is_processing())
+ if (is_processing()) {
data.tree->make_group_changed("idle_process");
+ }
- if (is_processing_internal())
+ if (is_processing_internal()) {
data.tree->make_group_changed("idle_process_internal");
+ }
- if (is_physics_processing())
+ if (is_physics_processing()) {
data.tree->make_group_changed("physics_process");
+ }
- if (is_physics_processing_internal())
+ if (is_physics_processing_internal()) {
data.tree->make_group_changed("physics_process_internal");
+ }
}
int Node::get_process_priority() const {