Skip to content

Commit

Permalink
Fix Gen5 save file detection
Browse files Browse the repository at this point in the history
Thanks xtreme1!
  • Loading branch information
kwsch committed May 17, 2016
1 parent c0a2a4b commit a317d38
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions Misc/SAV5.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,11 @@ public class SAV5 : PKM

internal static int getIsG5SAV(byte[] data)
{
ushort chk1 = BitConverter.ToUInt16(data, SIZE1 - 0x100 + 0x94 + 0x10);
ushort actual1 = ccitt16(data.Skip(SIZE1 - 0x100).Take(0x94).ToArray());
ushort chk1 = BitConverter.ToUInt16(data, SIZE1 - 0x100 + 0x8C + 0xE);
ushort actual1 = ccitt16(data.Skip(SIZE1 - 0x100).Take(0x8C).ToArray());
if (chk1 == actual1)
return 0;
ushort chk2 = BitConverter.ToUInt16(data, SIZE2 - 0x100 + 0x94 + 0x10);
ushort chk2 = BitConverter.ToUInt16(data, SIZE2 - 0x100 + 0x94 + 0xE);
ushort actual2 = ccitt16(data.Skip(SIZE2 - 0x100).Take(0x94).ToArray());
if (chk2 == actual2)
return 1;
Expand Down

0 comments on commit a317d38

Please sign in to comment.