GDScript: partially allow some functions on invalid scripts

+ always default initialize static variables
+ dont invalidate script when dependant scripts don't compile/resolve
This commit is contained in:
rune-scape 2024-06-02 02:07:47 -07:00 committed by rune-scape
parent 505da68b26
commit 7f7114c008
5 changed files with 101 additions and 136 deletions

View file

@ -3006,6 +3006,8 @@ Error GDScriptCompiler::_compile_class(GDScript *p_script, const GDScriptParser:
has_static_data = has_static_data || inner_class->has_static_data;
}
p_script->_static_default_init();
p_script->valid = true;
return OK;
}
@ -3228,11 +3230,7 @@ Error GDScriptCompiler::compile(const GDScriptParser *p_parser, GDScript *p_scri
GDScriptCache::add_static_script(p_script);
}
err = GDScriptCache::finish_compiling(main_script->path);
if (err) {
main_script->valid = false;
}
return err;
return GDScriptCache::finish_compiling(main_script->path);
}
String GDScriptCompiler::get_error() const {