summaryrefslogtreecommitdiffstats
path: root/core/io/file_access_pack.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'core/io/file_access_pack.cpp')
-rw-r--r--core/io/file_access_pack.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/core/io/file_access_pack.cpp b/core/io/file_access_pack.cpp
index 7595bc41f5..991b94db38 100644
--- a/core/io/file_access_pack.cpp
+++ b/core/io/file_access_pack.cpp
@@ -196,6 +196,8 @@ bool PackedSourcePCK::try_open_pack(const String &p_path, bool p_replace_files,
return false;
}
+ int64_t pck_start_pos = f->get_position() - 4;
+
uint32_t version = f->get_32();
uint32_t ver_major = f->get_32();
uint32_t ver_minor = f->get_32();
@@ -208,6 +210,7 @@ bool PackedSourcePCK::try_open_pack(const String &p_path, bool p_replace_files,
uint64_t file_base = f->get_64();
bool enc_directory = (pack_flags & PACK_DIR_ENCRYPTED);
+ bool rel_filebase = (pack_flags & PACK_REL_FILEBASE);
for (int i = 0; i < 16; i++) {
//reserved
@@ -216,6 +219,10 @@ bool PackedSourcePCK::try_open_pack(const String &p_path, bool p_replace_files,
int file_count = f->get_32();
+ if (rel_filebase) {
+ file_base += pck_start_pos;
+ }
+
if (enc_directory) {
Ref<FileAccessEncrypted> fae;
fae.instantiate();