fix gen3 once-saved saves

Catch a case that all BitOrder is 0. (after delete all data)
This commit is contained in:
pokecal 2017-04-13 04:59:50 +09:00 committed by GitHub
parent ac20c0574b
commit d49fdfbe89

View file

@ -206,6 +206,8 @@ namespace PKHeX.Core
// 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