Skip to content

Commit

Permalink
Fix sample chunk resource V2 offset table writing.
Browse files Browse the repository at this point in the history
  • Loading branch information
blueskythlikesclouds committed May 23, 2024
1 parent 9466916 commit 03b1c4b
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion Source/SharpNeedle/HedgehogEngine/Mirage/SampleChunkNode.cs
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,8 @@ private void Write(BinaryObjectWriter writer, bool lastNode)
using var token = new SeekToken(writer.GetBaseStream(), DataOffset - 8, SeekOrigin.Begin);
var offsets = writer.OffsetHandler.OffsetPositions.ToArray();

writer.PopOffsetOrigin();

writer.WriteOffset(() =>
{
// Offsets are relative to beginning of data
Expand All @@ -109,7 +111,6 @@ private void Write(BinaryObjectWriter writer, bool lastNode)
});

writer.Write(offsets.Length);
writer.PopOffsetOrigin();
}

using var endToken = writer.At();
Expand Down

0 comments on commit 03b1c4b

Please sign in to comment.