diff --git a/PKHeX.Core/Legality/Encounters/EncounterGenerator.cs b/PKHeX.Core/Legality/Encounters/EncounterGenerator.cs index 79af11657..a74ecbc97 100644 --- a/PKHeX.Core/Legality/Encounters/EncounterGenerator.cs +++ b/PKHeX.Core/Legality/Encounters/EncounterGenerator.cs @@ -624,6 +624,14 @@ private static IEnumerable GetFilteredSlots67(PKM pkm, IReadOnlyC int species = pkm.Species; int form = pkm.AltForm; + // Edge Case Handling + switch (species) + { + case 744 when form == 1: + case 745 when form == 2: + yield break; + } + if (AlolanVariantEvolutions12.Contains(species)) // match form if same species, else form 0. slotdata = encounterSlots.Where(slot => species == slot.Species ? slot.Form == form : slot.Form == 0); else if (ShouldMatchSlotForm()) // match slot form diff --git a/Tests/PKHeX.Tests/Legality/Illegal/Wild/744-01 - Rockruff - BEBC85FF60E2.pk7 b/Tests/PKHeX.Tests/Legality/Illegal/Wild/744-01 - Rockruff - BEBC85FF60E2.pk7 new file mode 100644 index 000000000..570c21530 Binary files /dev/null and b/Tests/PKHeX.Tests/Legality/Illegal/Wild/744-01 - Rockruff - BEBC85FF60E2.pk7 differ diff --git a/Tests/PKHeX.Tests/Legality/Illegal/Wild/745-02 - Lycanroc - 047385FF60E2.pk7 b/Tests/PKHeX.Tests/Legality/Illegal/Wild/745-02 - Lycanroc - 047385FF60E2.pk7 new file mode 100644 index 000000000..cd6a4de2d Binary files /dev/null and b/Tests/PKHeX.Tests/Legality/Illegal/Wild/745-02 - Lycanroc - 047385FF60E2.pk7 differ diff --git a/Tests/PKHeX.Tests/Legality/Legal/Generation 7 Wild/080 - Slowbro - A0935F4796B1.pk7 b/Tests/PKHeX.Tests/Legality/Legal/Generation 7 Wild/080 - Slowbro - A0935F4796B1.pk7 new file mode 100644 index 000000000..bbe994423 Binary files /dev/null and b/Tests/PKHeX.Tests/Legality/Legal/Generation 7 Wild/080 - Slowbro - A0935F4796B1.pk7 differ diff --git a/Tests/PKHeX.Tests/Legality/Legal/Generation 7 Wild/744 - Rockruff - B6F085FF60E2.pk7 b/Tests/PKHeX.Tests/Legality/Legal/Generation 7 Wild/744 - Rockruff - B6F085FF60E2.pk7 new file mode 100644 index 000000000..ad784b0eb Binary files /dev/null and b/Tests/PKHeX.Tests/Legality/Legal/Generation 7 Wild/744 - Rockruff - B6F085FF60E2.pk7 differ diff --git a/Tests/PKHeX.Tests/Legality/Legal/Generation 7 Wild/745 - Lycanroc - F45085FF60E2.pk7 b/Tests/PKHeX.Tests/Legality/Legal/Generation 7 Wild/745 - Lycanroc - F45085FF60E2.pk7 new file mode 100644 index 000000000..a2ec54075 Binary files /dev/null and b/Tests/PKHeX.Tests/Legality/Legal/Generation 7 Wild/745 - Lycanroc - F45085FF60E2.pk7 differ diff --git a/Tests/PKHeX.Tests/Legality/LegalityTests.cs b/Tests/PKHeX.Tests/Legality/LegalityTests.cs index a9b2a8136..29601980e 100644 --- a/Tests/PKHeX.Tests/Legality/LegalityTests.cs +++ b/Tests/PKHeX.Tests/Legality/LegalityTests.cs @@ -32,6 +32,7 @@ public void VerifyLegalityTest() folder = Path.Combine(folder, "Legality"); VerifyAll(folder, "Legal", true); + VerifyAll(folder, "Illegal", false); } // ReSharper disable once UnusedParameter.Local