aboutsummaryrefslogtreecommitdiff
path: root/scene/main/node.cpp
diff options
context:
space:
mode:
authorBojidar Marinov2016-11-17 18:46:45 +0200
committerBojidar Marinov2016-11-17 18:46:45 +0200
commitb6eab006dbd21d25a664486809109fffa9533124 (patch)
treee65a8e4deabe0715d9e81e544f4895d2c0f8534c /scene/main/node.cpp
parent184173a9b993c145a2782d9e2488b98221c749e1 (diff)
downloadgodot-b6eab006dbd21d25a664486809109fffa9533124.tar.gz
godot-b6eab006dbd21d25a664486809109fffa9533124.tar.zst
godot-b6eab006dbd21d25a664486809109fffa9533124.zip
Do not emit NOTIFICATION_READY more than once (breaking change)
Currently, there is no notification with the old behaviour, so probably breaks all cpp code relying on that notification as well.
Diffstat (limited to '')
-rw-r--r--scene/main/node.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/scene/main/node.cpp b/scene/main/node.cpp
index bff3c3a08..78a5cb730 100644
--- a/scene/main/node.cpp
+++ b/scene/main/node.cpp
@@ -166,14 +166,16 @@ 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++) {
data.children[i]->_propagate_ready();
}
data.blocked--;
- notification(NOTIFICATION_READY);
+ if(!data.ready_notified) {
+ data.ready_notified=true;
+ notification(NOTIFICATION_READY);
+ }
}
@@ -2663,9 +2665,7 @@ void Node::_set_tree(SceneTree *p_tree) {
_propagate_enter_tree();
- if (!data.parent || data.parent->data.ready_notified) { // No parent (root) or parent ready
- _propagate_ready(); //reverse_notification(NOTIFICATION_READY);
- }
+ _propagate_ready(); //reverse_notification(NOTIFICATION_READY);
tree_changed_b=data.tree;