Skip to content

Commit

Permalink
fix AddNewArchive() default i20 impl
Browse files Browse the repository at this point in the history
and switch to using .suit-like impl for .stage (for performance)
  • Loading branch information
Tkachov committed Apr 13, 2024
1 parent b1e9a9d commit c84b347
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
8 changes: 8 additions & 0 deletions DAT1/TOC.cs
Original file line number Diff line number Diff line change
Expand Up @@ -404,6 +404,14 @@ private uint AddNewArchive_Default(string filename) {
Filename = bytes
});

// fix all assets entries that referenced archives prior to the one added
var offsets = OffsetsSection.Entries;
foreach (var offset in offsets) {
if (offset.ArchiveIndex >= index) {
++offset.ArchiveIndex;
}
}

return (uint)index;
}

Expand Down
2 changes: 1 addition & 1 deletion Overstrike/Installers/StageInstaller.cs
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ public Helper(StageInstaller_I20 outer) {
_outer = outer;
}

protected override uint CreateArchive(string filename) => _outer._toc.AddNewArchive(filename, TOCBase.ArchiveAddingImpl.DEFAULT);
protected override uint CreateArchive(string filename) => _outer._toc.AddNewArchive(filename, TOCBase.ArchiveAddingImpl.SUITTOOL);

protected override ZipArchive ReadStageFile() => _outer.ReadModFile();

Expand Down

0 comments on commit c84b347

Please sign in to comment.