From ff6eea50423867f63764e3b85d3ad79c21119085 Mon Sep 17 00:00:00 2001 From: AThousandShips <96648715+AThousandShips@users.noreply.github.com> Date: Fri, 22 Nov 2024 17:42:58 +0100 Subject: [PATCH] Prevent infinite recursion in first `_draw` --- scene/main/node.cpp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/scene/main/node.cpp b/scene/main/node.cpp index 5063f0d6d0e6..43a781a2309e 100644 --- a/scene/main/node.cpp +++ b/scene/main/node.cpp @@ -120,10 +120,6 @@ void Node::_notification(int p_notification) { } #endif - if (data.auto_translate_mode != AUTO_TRANSLATE_MODE_DISABLED) { - notification(NOTIFICATION_TRANSLATION_CHANGED); - } - if (data.input) { add_to_group("_vp_input" + itos(get_viewport()->get_instance_id())); } @@ -147,6 +143,12 @@ void Node::_notification(int p_notification) { } } break; + case NOTIFICATION_POST_ENTER_TREE: { + if (data.auto_translate_mode != AUTO_TRANSLATE_MODE_DISABLED) { + notification(NOTIFICATION_TRANSLATION_CHANGED); + } + } break; + case NOTIFICATION_EXIT_TREE: { ERR_FAIL_NULL(get_viewport()); ERR_FAIL_NULL(get_tree());