From 19b6a8e42a917039c6665afffe2eafa3167f487a Mon Sep 17 00:00:00 2001 From: Sara Date: Wed, 1 Apr 2026 15:03:20 +0200 Subject: [PATCH] chore: clarified CompositeRule::_notification --- modules/generative_grammar/grammar.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/modules/generative_grammar/grammar.cpp b/modules/generative_grammar/grammar.cpp index 7f0f6e0dbb..82b385fa65 100644 --- a/modules/generative_grammar/grammar.cpp +++ b/modules/generative_grammar/grammar.cpp @@ -119,8 +119,12 @@ void CompositeRule::_bind_methods() { void CompositeRule::_notification(int what) { switch (what) { - case NOTIFICATION_READY: case NOTIFICATION_CHILD_ORDER_CHANGED: + if (!is_ready()) { + return; + } + // fall through + case NOTIFICATION_READY: this->rules.clear(); for (Variant child : get_children()) { if (Rule * rule{ cast_to(child) }) {