Skip SWSH untraded link trade eggs if trade-memory

just read the comments & code, this one is an annoying oversight
untraded pkm /should/ never have HT memory data, but sometimes it do be
like that

Closes #2571
This commit is contained in:
Kurt 2019-12-09 16:23:29 -08:00
parent aa2241ba66
commit 281c1ae744
2 changed files with 14 additions and 3 deletions

View file

@ -175,10 +175,20 @@ namespace PKHeX.Core
var pkm = data.pkm;
var Info = data.Info;
var memory = pkm.HT_Memory;
if (pkm.IsUntraded)
{
VerifyHTMemoryNone(data, pkm);
return;
if (memory == 4 && WasTradedSWSHEgg(pkm))
{
// Untraded link trade eggs in Gen8 have HT link trade memory applied erroneously.
// Verify the link trade memory later.
}
else
{
VerifyHTMemoryNone(data, pkm);
return;
}
}
if (pkm.Format == 7)
@ -188,7 +198,6 @@ namespace PKHeX.Core
}
var memoryGen = pkm.Format >= 8 ? 8 : 6;
var memory = pkm.HT_Memory;
// Bounds checking
switch (memoryGen)
@ -237,6 +246,8 @@ namespace PKHeX.Core
data.AddLine(commonResult);
}
private static bool WasTradedSWSHEgg(PKM pkm) => pkm.Gen8 && (pkm.WasTradedEgg || pkm.WasBredEgg);
private void VerifyHTMemoryTransferTo7(LegalityAnalysis data, PKM pkm, LegalInfo Info)
{
// Bank Transfer adds in the Link Trade Memory.