From 9699cdefaedb5b189ac7a8a3b26dc14da349e59a Mon Sep 17 00:00:00 2001 From: Kurt Date: Tue, 26 Sep 2017 20:09:18 -0700 Subject: [PATCH] Gen2 egg gift bypass fix Gen4+ static encounter eggs could slide through the VC case prevent empty moves from appearing before suggested moves (relearnbase being empty) --- PKHeX.Core/Legality/Analysis.cs | 2 +- PKHeX.Core/Legality/Encounters/EncounterGenerator.cs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/PKHeX.Core/Legality/Analysis.cs b/PKHeX.Core/Legality/Analysis.cs index aa9902178..1aec3599d 100644 --- a/PKHeX.Core/Legality/Analysis.cs +++ b/PKHeX.Core/Legality/Analysis.cs @@ -367,7 +367,7 @@ public int[] GetSuggestedRelearn() if (!pkm.WasEgg) return Info.RelearnBase; - List window = new List(Info.RelearnBase); + List window = new List(Info.RelearnBase.Where(z => z != 0)); window.AddRange(pkm.Moves.Where((v, i) => !Info.Moves[i].Valid || Info.Moves[i].Flag)); window = window.Distinct().ToList(); int[] moves = new int[4]; diff --git a/PKHeX.Core/Legality/Encounters/EncounterGenerator.cs b/PKHeX.Core/Legality/Encounters/EncounterGenerator.cs index 500f36e94..2aa006913 100644 --- a/PKHeX.Core/Legality/Encounters/EncounterGenerator.cs +++ b/PKHeX.Core/Legality/Encounters/EncounterGenerator.cs @@ -420,7 +420,7 @@ private static IEnumerable GetMatchingStaticEncounters(PKM pkm, if (pkm.Format == 3 && pkm.IsEgg && e.EggLocation != pkm.Met_Location) continue; } - else if (pkm.VC || e.EggLocation != 0) // Gen2 Egg + else if (pkm.VC || pkm.GenNumber <= 2 && e.EggLocation != 0) // Gen2 Egg { if (pkm.Format <= 2) {