From 1e2ef19d9a565a77b490621eed32431171903ee3 Mon Sep 17 00:00:00 2001 From: Kaphotics Date: Sun, 3 Jul 2016 18:27:12 -0700 Subject: [PATCH] Tweak detection of pk6 party file --- PKM/PKMConverter.cs | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/PKM/PKMConverter.cs b/PKM/PKMConverter.cs index 12115760b..fc8768ba8 100644 --- a/PKM/PKMConverter.cs +++ b/PKM/PKMConverter.cs @@ -40,15 +40,16 @@ namespace PKHeX case PKX.SIZE_6PARTY: // collision with PGT, same size. if (BitConverter.ToUInt16(data, 0x4) != 0) // Bad Sanity? return -1; + if (BitConverter.ToUInt32(data, 0x06) == PKX.getCHK(data)) + return 6; if (BitConverter.ToUInt16(data, 0x58) != 0) // Encrypted? { - PKX.getCHK(data); for (int i = data.Length - 0x10; i < data.Length; i++) // 0x10 of 00's at the end != PK6 if (data[i] != 0) - break; - return 6; + return 6; + return -1; } - return -1; + return 6; } return -1; }