diff options
| author | Bojidar Marinov | 2016-11-17 18:10:53 +0200 |
|---|---|---|
| committer | Bojidar Marinov | 2016-11-17 18:10:53 +0200 |
| commit | 184173a9b993c145a2782d9e2488b98221c749e1 (patch) | |
| tree | a7ef4f689220fb4e17ddf1d8ae15256727a22d5b /scene/main/node.cpp | |
| parent | 959683c3d8f7aaa7469d5758c7698e0da108b406 (diff) | |
| download | godot-184173a9b993c145a2782d9e2488b98221c749e1.tar.gz godot-184173a9b993c145a2782d9e2488b98221c749e1.tar.zst godot-184173a9b993c145a2782d9e2488b98221c749e1.zip | |
Guard agains duplicate calling of _ready when instanced in _enter_tree
Fixes #6005
Diffstat (limited to 'scene/main/node.cpp')
| -rw-r--r-- | scene/main/node.cpp | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/scene/main/node.cpp b/scene/main/node.cpp index f4fb48682..bff3c3a08 100644 --- a/scene/main/node.cpp +++ b/scene/main/node.cpp @@ -166,6 +166,7 @@ void Node::_notification(int p_notification) { void Node::_propagate_ready() { + data.ready_notified=true; data.blocked++; for (int i=0;i<data.children.size();i++) { @@ -2662,7 +2663,9 @@ void Node::_set_tree(SceneTree *p_tree) { _propagate_enter_tree(); - _propagate_ready(); //reverse_notification(NOTIFICATION_READY); + if (!data.parent || data.parent->data.ready_notified) { // No parent (root) or parent ready + _propagate_ready(); //reverse_notification(NOTIFICATION_READY); + } tree_changed_b=data.tree; @@ -2999,6 +3002,7 @@ Node::Node() { data.fixed_process=false; data.idle_process=false; data.inside_tree=false; + data.ready_notified=false; data.owner=NULL; data.OW=NULL; |
