Skip to content

Commit 0f6f4df

Browse files
committed
Updated UE4.26 pak file fix
1 parent daa3c14 commit 0f6f4df

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
@@ -171,7 +171,8 @@ void FPakEntry::DecodeFrom(const uint8* Data)
171171
Data += sizeof(uint32);
172172

173173
// CompressionBlockSize
174-
if ((Bitfield & 0x3f) == 0x3f)
174+
bool bLegacyCompressionBlockSize = ((Bitfield & 0x3f) != 0x3f);
175+
if (!bLegacyCompressionBlockSize)
175176
{
176177
// UE4.27+
177178
CompressionBlockSize = *(uint32*)Data;
@@ -249,6 +250,12 @@ void FPakEntry::DecodeFrom(const uint8* Data)
249250
// Adjust CompressionBlockSize for small blocks
250251
if (UncompressedSize < CompressionBlockSize)
251252
{
253+
// UE4.27+ code
254+
CompressionBlockSize = UncompressedSize;
255+
}
256+
else if (bLegacyCompressionBlockSize && UncompressedSize < 65536)
257+
{
258+
// UE4.26 code
252259
CompressionBlockSize = UncompressedSize;
253260
}
254261

umodel

0 Bytes
Binary file not shown.

umodel.exe

0 Bytes
Binary file not shown.

0 commit comments

Comments
 (0)