Skip to content

Commit

Permalink
Merge pull request #89005 from dalexeev/gds-fix-res-format-loader-path
Browse files Browse the repository at this point in the history
GDScript: Fix paths in `ResourceFormatLoaderGDScript::load()`
  • Loading branch information
akien-mga committed Feb 29, 2024
2 parents 5c38a9f + 0908ad4 commit 7d2ca2d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions modules/gdscript/gdscript.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2818,11 +2818,11 @@ Ref<GDScript> GDScriptLanguage::get_script_by_fully_qualified_name(const String
Ref<Resource> ResourceFormatLoaderGDScript::load(const String &p_path, const String &p_original_path, Error *r_error, bool p_use_sub_threads, float *r_progress, CacheMode p_cache_mode) {
Error err;
bool ignoring = p_cache_mode == CACHE_MODE_IGNORE || p_cache_mode == CACHE_MODE_IGNORE_DEEP;
Ref<GDScript> scr = GDScriptCache::get_full_script(p_path, err, "", ignoring);
Ref<GDScript> scr = GDScriptCache::get_full_script(p_original_path, err, "", ignoring);

if (err && scr.is_valid()) {
// If !scr.is_valid(), the error was likely from scr->load_source_code(), which already generates an error.
ERR_PRINT_ED(vformat(R"(Failed to load script "%s" with error "%s".)", p_path, error_names[err]));
ERR_PRINT_ED(vformat(R"(Failed to load script "%s" with error "%s".)", p_original_path, error_names[err]));
}

if (r_error) {
Expand Down

0 comments on commit 7d2ca2d

Please sign in to comment.