Fix insert not adjusting overall file size

Indirectly fixes pk3DS's TitleScreen loading bug where not enough data
is returned.
This commit is contained in:
Kurt
2015-11-03 19:55:40 -08:00
parent f16148dac0
commit e9d0c566cf

View File

@@ -338,7 +338,8 @@ internal static bool insertFile(ref DARC orig, int index, byte[] data)
// Fix Offset references of other files
foreach (var x in orig.Entries.Where(x => x.DataOffset >= offset + oldLength))
x.DataOffset += (uint) diff;
orig.Entries[index].DataLength = (uint)data.Length;
orig.Entries[index].DataLength = (uint)data.Length;
orig.Header.FileSize += (uint)diff;
return true;
}
catch (Exception) { return false; }