Merge pull request #68927 from rune-scape/rune-cache-parse-error

GDScript: Cache scripts after parse error
This commit is contained in:
Rémi Verschelde 2022-11-20 23:25:19 +01:00
commit 15df1ffa9b
No known key found for this signature in database
GPG Key ID: C3336907360768E1

View File

@ -242,12 +242,10 @@ Ref<GDScript> GDScriptCache::get_shallow_script(const String &p_path, Error &r_e
script->load_source_code(p_path);
Ref<GDScriptParserRef> parser_ref = get_parser(p_path, GDScriptParserRef::PARSED, r_error);
if (r_error != OK) {
return script;
if (r_error == OK) {
GDScriptCompiler::make_scripts(script.ptr(), parser_ref->get_parser()->get_tree(), true);
}
GDScriptCompiler::make_scripts(script.ptr(), parser_ref->get_parser()->get_tree(), true);
singleton->shallow_gdscript_cache[p_path] = script;
return script;
}