mirror of
https://github.com/kwsch/pk3DS.git
synced 2026-10-02 05:46:47 -05:00
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:
@@ -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; }
|
||||
|
||||
Reference in New Issue
Block a user