Fix Gen5 save file detection

Thanks xtreme1!
This commit is contained in:
Kaphotics
2016-05-16 22:09:26 -07:00
parent c0a2a4b2a7
commit a317d38bf4

View File

@@ -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;