diff options
Diffstat (limited to 'core/io/file_access_zip.cpp')
-rw-r--r-- | core/io/file_access_zip.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/core/io/file_access_zip.cpp b/core/io/file_access_zip.cpp index c3a62706c7..974bb65a18 100644 --- a/core/io/file_access_zip.cpp +++ b/core/io/file_access_zip.cpp @@ -147,8 +147,11 @@ unzFile ZipArchive::get_file_handle(String p_file) const { return pkg; } -bool ZipArchive::try_open_pack(const String &p_path, bool p_replace_files) { +bool ZipArchive::try_open_pack(const String &p_path, bool p_replace_files, size_t p_offset = 0) { //printf("opening zip pack %ls, %i, %i\n", p_name.c_str(), p_name.extension().nocasecmp_to("zip"), p_name.extension().nocasecmp_to("pcz")); + // load with offset feature only supported for PCK files + ERR_FAIL_COND_V_MSG(p_offset != 0, false, "Invalid PCK data. Note that loading files with a non-zero offset isn't supported with ZIP archives."); + if (p_path.get_extension().nocasecmp_to("zip") != 0 && p_path.get_extension().nocasecmp_to("pcz") != 0) { return false; } |