diff --git a/CMNDAT/SaveData.cs b/CMNDAT/SaveData.cs index 42dbf5f..58fe5b7 100644 --- a/CMNDAT/SaveData.cs +++ b/CMNDAT/SaveData.cs @@ -33,7 +33,7 @@ public bool Open(String filename) try { - Byte[] comp = tmp[HeaderLength..^0]; + Byte[] comp = tmp[HeaderLength..]; using (var input = new MemoryStream(comp)) { using (var zlib = new System.IO.Compression.ZLibStream(input, System.IO.Compression.CompressionMode.Decompress)) @@ -51,7 +51,7 @@ public bool Open(String filename) return false; } - mHeader = tmp[0..HeaderLength]; + mHeader = tmp[..HeaderLength]; mFileName = filename; return true; } diff --git a/SCSHDAT/SaveData.cs b/SCSHDAT/SaveData.cs index 8b9c672..11add51 100644 --- a/SCSHDAT/SaveData.cs +++ b/SCSHDAT/SaveData.cs @@ -34,7 +34,7 @@ public bool Open(String filename) try { - Byte[] comp = tmp[HeaderLength..^0]; + Byte[] comp = tmp[HeaderLength..]; using (var input = new MemoryStream(comp)) { using (var zlib = new System.IO.Compression.ZLibStream(input, System.IO.Compression.CompressionMode.Decompress)) @@ -52,7 +52,7 @@ public bool Open(String filename) return false; } - mHeader = tmp[0..HeaderLength]; + mHeader = tmp[..HeaderLength]; mFileName = filename; return true; } diff --git a/STGDAT/SaveData.cs b/STGDAT/SaveData.cs index 76272b3..cd3a7ca 100644 --- a/STGDAT/SaveData.cs +++ b/STGDAT/SaveData.cs @@ -2,6 +2,7 @@ using System.Collections.Generic; using System.IO; using System.Linq; +using System.Reflection.PortableExecutable; namespace STGDAT { @@ -39,7 +40,7 @@ public bool Open(String filename) try { - Byte[] comp = tmp[HeaderLength..^0]; + Byte[] comp = tmp[HeaderLength..]; mBuffer = Decomp(comp); } catch @@ -47,6 +48,7 @@ public bool Open(String filename) return false; } + mHeader = tmp[..HeaderLength]; mFileName = filename; return true; }