Guard agains duplicate calling of _ready when instanced in _enter_tree
Fixes #6005
This commit is contained in:
parent
959683c3d8
commit
184173a9b9
2 changed files with 6 additions and 1 deletions
|
@ -166,6 +166,7 @@ void Node::_notification(int p_notification) {
|
||||||
|
|
||||||
void Node::_propagate_ready() {
|
void Node::_propagate_ready() {
|
||||||
|
|
||||||
|
data.ready_notified=true;
|
||||||
data.blocked++;
|
data.blocked++;
|
||||||
for (int i=0;i<data.children.size();i++) {
|
for (int i=0;i<data.children.size();i++) {
|
||||||
|
|
||||||
|
@ -2662,7 +2663,9 @@ void Node::_set_tree(SceneTree *p_tree) {
|
||||||
|
|
||||||
|
|
||||||
_propagate_enter_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;
|
tree_changed_b=data.tree;
|
||||||
|
|
||||||
|
@ -2999,6 +3002,7 @@ Node::Node() {
|
||||||
data.fixed_process=false;
|
data.fixed_process=false;
|
||||||
data.idle_process=false;
|
data.idle_process=false;
|
||||||
data.inside_tree=false;
|
data.inside_tree=false;
|
||||||
|
data.ready_notified=false;
|
||||||
|
|
||||||
data.owner=NULL;
|
data.owner=NULL;
|
||||||
data.OW=NULL;
|
data.OW=NULL;
|
||||||
|
|
|
@ -103,6 +103,7 @@ private:
|
||||||
StringName name;
|
StringName name;
|
||||||
SceneTree *tree;
|
SceneTree *tree;
|
||||||
bool inside_tree;
|
bool inside_tree;
|
||||||
|
bool ready_notified;
|
||||||
#ifdef TOOLS_ENABLED
|
#ifdef TOOLS_ENABLED
|
||||||
NodePath import_path; //path used when imported, used by scene editors to keep tracking
|
NodePath import_path; //path used when imported, used by scene editors to keep tracking
|
||||||
#endif
|
#endif
|
||||||
|
|
Loading…
Reference in a new issue