diff --git a/pkNX.Containers/SingleFileContainer.cs b/pkNX.Containers/SingleFileContainer.cs index 9b967266..930975f3 100644 --- a/pkNX.Containers/SingleFileContainer.cs +++ b/pkNX.Containers/SingleFileContainer.cs @@ -1,4 +1,5 @@ using System.IO; +using System.Linq; using System.Threading; using System.Threading.Tasks; @@ -24,7 +25,16 @@ public void CancelEdits() Data = (byte[]) Backup.Clone(); } - public byte[] this[int index] { get => Data; set => Data = value; } + public byte[] this[int index] + { + get => (byte[])Data.Clone(); + set + { + Modified |= Data.SequenceEqual(value); + Data = value; + } + } + public Task GetFiles() => Task.FromResult(new[] {Data}); public Task GetFile(int file, int subFile = 0) => Task.FromResult(Data); public Task SetFile(int file, byte[] value, int subFile = 0) => Task.FromResult(Data = value);