Skip to content

Commit

Permalink
[MapleLib] fixed an issue saving hotfix Data.wz file (0 bytes)
Browse files Browse the repository at this point in the history
  • Loading branch information
lastbattle committed Dec 20, 2022
1 parent 8c1cbe4 commit 6aed4ba
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions MapleLib/WzLib/WzImage.cs
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ public int Checksum {
private set { }
}
/// <summary>
/// The offset of the image
/// The offset of the start of this image
/// </summary>
public uint Offset { get { return offset; } set { offset = value; } }
public int BlockStart { get { return blockStart; } }
Expand Down Expand Up @@ -454,8 +454,9 @@ public void SaveImage(WzBinaryWriter writer, bool bIsWzUserKeyDefault = true, bo
{
long pos = reader.BaseStream.Position;
reader.BaseStream.Position = offset;
writer.Write(reader.ReadBytes(size));
reader.BaseStream.Position = pos;
writer.Write(reader.ReadBytes((int) pos));

reader.BaseStream.Position = pos; // reset
}
}

Expand Down

0 comments on commit 6aed4ba

Please sign in to comment.