PCK file path improvements

Fixes godotengine#77317 (Inconsistent PCK file path behaviour).
Simplifies all PCK file paths so that paths with extra '/' symbols in them
still match to the same path.
Fixes various FileAccess methods that didn't work when using PCK paths that
contain extra '/' symbols.
This commit is contained in:
jpcerrone
2023-05-22 15:03:05 -03:00
parent 5dc093b19a
commit 0fb307720c
3 changed files with 10 additions and 6 deletions

View File

@ -115,7 +115,9 @@ Error PCKPacker::add_file(const String &p_file, const String &p_src, bool p_encr
}
File pf;
pf.path = p_file;
// Simplify path here and on every 'files' access so that paths that have extra '/'
// symbols in them still match to the MD5 hash for the saved path.
pf.path = p_file.simplify_path();
pf.src_path = p_src;
pf.ofs = ofs;
pf.size = f->get_length();