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) }) {