From bbf14742c11f1704c0ad00b8b7e6ddf760081d4e Mon Sep 17 00:00:00 2001 From: Kyler Li <46853114+loukylor@users.noreply.github.com> Date: Sat, 4 Apr 2026 02:40:36 -0700 Subject: [PATCH] bug: calculate decompressed block infos length before aligning --- .../Standard/AssetsBundleFileFormat/AssetBundleFile.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/AssetTools.NET/Standard/AssetsBundleFileFormat/AssetBundleFile.cs b/AssetTools.NET/Standard/AssetsBundleFileFormat/AssetBundleFile.cs index a7b9231..acd55eb 100644 --- a/AssetTools.NET/Standard/AssetsBundleFileFormat/AssetBundleFile.cs +++ b/AssetTools.NET/Standard/AssetsBundleFileFormat/AssetBundleFile.cs @@ -173,13 +173,13 @@ public void Write(AssetsFileWriter writer, long filePos = 0) newBundleInf.DirectoryInfos = dirInfos; newBundleInf.Write(writer); + long assetDataPos = writer.Position; + if ((Header.FileStreamHeader.Flags & AssetBundleFSHeaderFlags.BlockInfoNeedPaddingAtStart) != 0) { writer.Align16(); } - long assetDataPos = writer.Position; - // write the updated directory infos for (int i = 0; i < dirInfos.Count; i++) {