Skip to content

Commit 24e7295

Browse files
authored
fix: 🐛 Take resource remapping into account (#524)
fix: 🐛 Take resource remapping into account (#482) added `ResourceLoader.exists()` to `_ModLoaderFile.file_exists()` closes #481
1 parent b99a502 commit 24e7295

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

addons/mod_loader/internal/file.gd

+7-1
Original file line numberDiff line numberDiff line change
@@ -207,7 +207,13 @@ static func remove_file(file_path: String) -> bool:
207207

208208
static func file_exists(path: String) -> bool:
209209
var file := File.new()
210-
return file.file_exists(path)
210+
var exists := file.file_exists(path)
211+
212+
# If the file is not found, check if it has been remapped because it is a Resource.
213+
if not exists:
214+
exists = ResourceLoader.exists(path)
215+
216+
return exists
211217

212218

213219
static func dir_exists(path: String) -> bool:

0 commit comments

Comments
 (0)