diff options
author | Rémi Verschelde <rverschelde@gmail.com> | 2022-11-20 23:25:19 +0100 |
---|---|---|
committer | Rémi Verschelde <rverschelde@gmail.com> | 2022-11-20 23:25:19 +0100 |
commit | 15df1ffa9ba4b007150ae407b7d3b23918b086fa (patch) | |
tree | 90d030ce1536c2e2c28784f0c74a8d34a9f7dff1 /modules/gdscript | |
parent | 819437915f6abe2f9ecf607296cf320f06d2ea5c (diff) | |
parent | 5ef971da1a9912f0191867e64c9c2055a75bf011 (diff) |
Merge pull request #68927 from rune-scape/rune-cache-parse-error
GDScript: Cache scripts after parse error
Diffstat (limited to 'modules/gdscript')
-rw-r--r-- | modules/gdscript/gdscript_cache.cpp | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/modules/gdscript/gdscript_cache.cpp b/modules/gdscript/gdscript_cache.cpp index 00ae5f43c5..bf84e55b4c 100644 --- a/modules/gdscript/gdscript_cache.cpp +++ b/modules/gdscript/gdscript_cache.cpp @@ -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; } |