diff --git a/PKHeX.Core/Legality/Encounters/Generator/Moveset/EncounterMovesetGenerator.cs b/PKHeX.Core/Legality/Encounters/Generator/Moveset/EncounterMovesetGenerator.cs index 709500a7c..86ab9f80d 100644 --- a/PKHeX.Core/Legality/Encounters/Generator/Moveset/EncounterMovesetGenerator.cs +++ b/PKHeX.Core/Legality/Encounters/Generator/Moveset/EncounterMovesetGenerator.cs @@ -180,10 +180,7 @@ private static IEnumerable GetMovesForGeneration(PKM pk, IReadOnlyList= 0; + } + + public static int[] GetSharedEggMoves(PKM pkm, int gen) + { + if (gen < 8 || pkm.IsEgg) + return Array.Empty(); var table = PersonalTable.SWSH; var entry = (PersonalInfoSWSH)table.GetFormEntry(pkm.Species, pkm.Form); var baseSpecies = entry.HatchSpecies; var baseForm = entry.HatchFormIndexEverstone; - var egg = GetEggMoves(8, baseSpecies, baseForm, SW); - return Array.Exists(egg, z => z == move); + return GetEggMoves(8, baseSpecies, baseForm, SW); } } }