Skip to content

Commit 65ffb58

Browse files
committed
UE4 pak file with zero-length file did hide another file
Example: - pak1.pak: file.uasset (15 kb) - pak2.pak: file.uasset (0 bytes) While scanning the game directory, the file from pak2 will replace previously loaded entry from pak1, with zero file length, what will make package inaccessible. Now, avoiding registraction of null files.
1 parent 18f3ec7 commit 65ffb58

File tree

3 files changed

+8
-1
lines changed

3 files changed

+8
-1
lines changed

Unreal/FileSystem/UnArchivePak.cpp

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -739,9 +739,16 @@ bool FPakVFS::LoadPakIndexLegacy(FArchive* reader, const FPakInfo& info, FString
739739
CompactFilePath(CombinedPath);
740740
// serialize other fields
741741
E.Serialize(InfoReader);
742+
743+
if (E.Size == 0)
744+
{
745+
// Happens with Jedi Fallen Order, seems assets are deleted in patches this way. If we'll continue registration,
746+
// the existing (previous) asset might be overriden with zero-size file, and it won't be recognized as an asset anymore.
747+
continue;
748+
}
749+
742750
if (E.bEncrypted)
743751
{
744-
// appPrintf("Encrypted file: %s\n", *Filename);
745752
NumEncryptedFiles++;
746753
}
747754
if (info.Version >= PakFile_Version_FNameBasedCompressionMethod)

umodel

0 Bytes
Binary file not shown.

umodel.exe

0 Bytes
Binary file not shown.

0 commit comments

Comments
 (0)