diff options
author | RĂ©mi Verschelde <rverschelde@gmail.com> | 2019-08-18 10:52:55 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-08-18 10:52:55 +0200 |
commit | 343466c0159dc5e77ab1ce8ea313b1decbc5665b (patch) | |
tree | 6f1a0bd92ff7646f6f2872fa45803c0f2cad7e78 | |
parent | cc9f2a2d8bf36e7244e7291ad7fdb32a3e3f2ef2 (diff) | |
parent | ad8746e0de047b9153496d2c88cb14a92cc82be9 (diff) |
Merge pull request #31440 from akien-mga/diraccesspack-dir_exists
DirAccessPack: Fix dir_exists and file_exists for res:// paths
-rw-r--r-- | core/io/file_access_pack.cpp | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/core/io/file_access_pack.cpp b/core/io/file_access_pack.cpp index 6b683759f8..d49d36c2b9 100644 --- a/core/io/file_access_pack.cpp +++ b/core/io/file_access_pack.cpp @@ -90,7 +90,7 @@ void PackedData::add_path(const String &pkg_path, const String &path, uint64_t o } } String filename = path.get_file(); - // Don't add as a file if the path points to a directoryy + // Don't add as a file if the path points to a directory if (!filename.empty()) { cd->files.insert(filename); } @@ -460,11 +460,15 @@ String DirAccessPack::get_current_dir() { bool DirAccessPack::file_exists(String p_file) { + p_file = fix_path(p_file); + return current->files.has(p_file); } bool DirAccessPack::dir_exists(String p_dir) { + p_dir = fix_path(p_dir); + return current->subdirs.has(p_dir); } |