Merge pull request #114131 from gilzoide/bugfix/script-language-init-first-filesystem-scan

Make sure `ScriptLanguage` is initialized even after `init_languages` call
This commit is contained in:
Thaddeus Crews 2026-02-03 18:06:45 -06:00
commit 3d2a2d3968
No known key found for this signature in database
GPG key ID: 8C6E5FEB5FC03CCC

View file

@ -253,6 +253,13 @@ Error ScriptServer::register_language(ScriptLanguage *p_language) {
ERR_FAIL_COND_V_MSG(other_language->get_type() == p_language->get_type(), ERR_ALREADY_EXISTS, vformat("A script language with type '%s' is already registered.", p_language->get_type()));
}
_languages[_language_count++] = p_language;
// Make sure the new language is initialized in case languages have already been initialized before
// This happens when importing the GDExtension for the first time in the editor
if (languages_ready) {
p_language->init();
}
return OK;
}