From d49fdfbe89c443b322c1e0dfcae3ee5d284d2940 Mon Sep 17 00:00:00 2001 From: pokecal Date: Thu, 13 Apr 2017 04:59:50 +0900 Subject: [PATCH] fix gen3 once-saved saves Catch a case that all BitOrder is 0. (after delete all data) --- PKHeX/Saves/SaveUtil.cs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/PKHeX/Saves/SaveUtil.cs b/PKHeX/Saves/SaveUtil.cs index 86e8390d0..51381fedd 100644 --- a/PKHeX/Saves/SaveUtil.cs +++ b/PKHeX/Saves/SaveUtil.cs @@ -206,6 +206,8 @@ public static GameVersion getIsG3SAV(byte[] data) // Real 0th block comes before block1. if (BlockOrder[0] == 1 && Block0 != BlockOrder.Length - 1) continue; + if (BlockOrder.Count(v => v == 0) == BlockOrder.Length) + continue; uint GameCode = BitConverter.ToUInt32(data, Block0 * 0x1000 + 0xAC + ofs); if (GameCode == uint.MaxValue) return GameVersion.Unknown; // what a hack