From 184173a9b993c145a2782d9e2488b98221c749e1 Mon Sep 17 00:00:00 2001 From: Bojidar Marinov Date: Thu, 17 Nov 2016 18:10:53 +0200 Subject: [PATCH] Guard agains duplicate calling of _ready when instanced in _enter_tree Fixes #6005 --- scene/main/node.cpp | 6 +++++- scene/main/node.h | 1 + 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/scene/main/node.cpp b/scene/main/node.cpp index f4fb48682c9..bff3c3a0897 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;idata.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; diff --git a/scene/main/node.h b/scene/main/node.h index f18dc81195b..7b1444f6079 100644 --- a/scene/main/node.h +++ b/scene/main/node.h @@ -103,6 +103,7 @@ private: StringName name; SceneTree *tree; bool inside_tree; + bool ready_notified; #ifdef TOOLS_ENABLED NodePath import_path; //path used when imported, used by scene editors to keep tracking #endif