mirror of
https://github.com/godotengine/godot.git
synced 2024-11-25 05:33:11 +00:00
Merge pull request #89005 from dalexeev/gds-fix-res-format-loader-path
GDScript: Fix paths in `ResourceFormatLoaderGDScript::load()`
This commit is contained in:
commit
7d2ca2d8ac
@ -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) {
|
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;
|
Error err;
|
||||||
bool ignoring = p_cache_mode == CACHE_MODE_IGNORE || p_cache_mode == CACHE_MODE_IGNORE_DEEP;
|
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 (err && scr.is_valid()) {
|
||||||
// If !scr.is_valid(), the error was likely from scr->load_source_code(), which already generates an error.
|
// 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) {
|
if (r_error) {
|
||||||
|
Loading…
Reference in New Issue
Block a user