From 2f00192cc70ac5598554d82a0e59002911ad86e3 Mon Sep 17 00:00:00 2001 From: Alex Barney Date: Sat, 21 Jul 2018 22:25:55 -0500 Subject: [PATCH] Fix RemapStream bug --- libhac/Savefile/RemapStream.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/libhac/Savefile/RemapStream.cs b/libhac/Savefile/RemapStream.cs index 490094f4..98baf677 100644 --- a/libhac/Savefile/RemapStream.cs +++ b/libhac/Savefile/RemapStream.cs @@ -53,14 +53,14 @@ namespace libhac.Savefile if (remaining < count) count = (int)remaining; var toOutput = count; - int pos = 0; + int outPos = offset; while (toOutput > 0) { var remainInEntry = CurrentEntry.VirtualOffsetEnd - Position; int toRead = (int)Math.Min(toOutput, remainInEntry); - BaseStream.Read(buffer, pos, toRead); - pos += toRead; + BaseStream.Read(buffer, outPos, toRead); + outPos += toRead; toOutput -= toRead; Position += toRead; }