From bb6c5e3dbb62e420028a8e9dd7388aaa97d4cc04 Mon Sep 17 00:00:00 2001 From: Kurt Date: Sun, 11 Jun 2017 18:39:19 -0700 Subject: [PATCH] Add static encounter egg edge case handling Closes #1219 reject the eevee case if any relearn moves are present allow traded eggs to be matched --- .../Legality/Encounters/EncounterGenerator.cs | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/PKHeX.Core/Legality/Encounters/EncounterGenerator.cs b/PKHeX.Core/Legality/Encounters/EncounterGenerator.cs index 96bbe5927..72226e871 100644 --- a/PKHeX.Core/Legality/Encounters/EncounterGenerator.cs +++ b/PKHeX.Core/Legality/Encounters/EncounterGenerator.cs @@ -310,7 +310,19 @@ private static IEnumerable getMatchingStaticEncounters(PKM pkm, continue; } else if (e.EggLocation != pkm.Egg_Location) - continue; + { + switch (pkm.GenNumber) + { + case 4: + if (pkm.Egg_Location != 2002) // Link Trade + continue; + break; + default: + if (pkm.Egg_Location != 30002) // Link Trade + continue; + break; + } + } if (pkm.HasOriginalMetLocation) { if (e.Location != 0 && e.Location != pkm.Met_Location) @@ -324,6 +336,8 @@ private static IEnumerable getMatchingStaticEncounters(PKM pkm, continue; if (e.Form != pkm.AltForm && !e.SkipFormCheck && !getCanFormChange(pkm, e.Species)) continue; + if (e.EggLocation == 60002 && e.Relearn[0] == 0 && pkm.RelearnMoves.Any(z => z != 0)) // gen7 eevee edge case + continue; if (pkm is PK1 pk1 && pkm.Gen1_NotTradeback) {