Skip to content

Commit

Permalink
refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
turtle-insect committed Nov 16, 2024
1 parent cdd99f2 commit 79d6364
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 5 deletions.
4 changes: 2 additions & 2 deletions CMNDAT/SaveData.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand All @@ -51,7 +51,7 @@ public bool Open(String filename)
return false;
}

mHeader = tmp[0..HeaderLength];
mHeader = tmp[..HeaderLength];
mFileName = filename;
return true;
}
Expand Down
4 changes: 2 additions & 2 deletions SCSHDAT/SaveData.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand All @@ -52,7 +52,7 @@ public bool Open(String filename)
return false;
}

mHeader = tmp[0..HeaderLength];
mHeader = tmp[..HeaderLength];
mFileName = filename;
return true;
}
Expand Down
4 changes: 3 additions & 1 deletion STGDAT/SaveData.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Reflection.PortableExecutable;

namespace STGDAT
{
Expand Down Expand Up @@ -39,14 +40,15 @@ public bool Open(String filename)

try
{
Byte[] comp = tmp[HeaderLength..^0];
Byte[] comp = tmp[HeaderLength..];
mBuffer = Decomp(comp);
}
catch
{
return false;
}

mHeader = tmp[..HeaderLength];
mFileName = filename;
return true;
}
Expand Down

0 comments on commit 79d6364

Please sign in to comment.