Skip to content

Commit

Permalink
Prevent infinite recursion in first _draw
Browse files Browse the repository at this point in the history
  • Loading branch information
AThousandShips committed Nov 22, 2024
1 parent f952bfe commit ff6eea5
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions scene/main/node.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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()));
}
Expand All @@ -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());
Expand Down

0 comments on commit ff6eea5

Please sign in to comment.