mirror of
https://github.com/kwsch/PKHeX
synced 2024-11-14 16:27:21 +00:00
Fix for XD. XF files testes from inside a memory card only return true in getIsG3XDSAV if ignore the second pass in the for, only the first is equal to the sequence
This commit is contained in:
parent
a38e923e83
commit
b53a101f20
1 changed files with 6 additions and 2 deletions
|
@ -274,12 +274,16 @@ namespace PKHeX.Core
|
|||
// Check the intro bytes for each save slot
|
||||
byte[] slotintroXD = { 0x01, 0x01, 0x01, 0x00 };
|
||||
int offset = data.Length - SIZE_G3XD;
|
||||
// For XD savegames inside a memory card only the firs sequence is equal to slotintroXD
|
||||
bool valid = false;
|
||||
for (int i = 0; i < 2; i++)
|
||||
{
|
||||
var ident = data.Skip(0x6000 + offset + 0x28000 * i).Take(4);
|
||||
if (!ident.SequenceEqual(slotintroXD))
|
||||
return GameVersion.Invalid;
|
||||
if (ident.SequenceEqual(slotintroXD))
|
||||
valid = true;
|
||||
}
|
||||
if(!valid)
|
||||
return GameVersion.Invalid;
|
||||
return GameVersion.XD;
|
||||
}
|
||||
/// <summary>Determines the type of 4th gen save</summary>
|
||||
|
|
Loading…
Reference in a new issue