From c2f26a2e6866e02fc651575a3bd18f6d6ad649db Mon Sep 17 00:00:00 2001 From: Kurt Date: Fri, 11 Nov 2016 22:13:40 -0800 Subject: [PATCH] Fix alolan form egg move fetch --- PKHeX/Legality/Core.cs | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/PKHeX/Legality/Core.cs b/PKHeX/Legality/Core.cs index 6f76deb42..2ea96f4e9 100644 --- a/PKHeX/Legality/Core.cs +++ b/PKHeX/Legality/Core.cs @@ -160,7 +160,14 @@ internal static IEnumerable getValidRelearn(PKM pkm, int skipOption) List r = new List { 0 }; int species = getBaseSpecies(pkm, skipOption); r.AddRange(getLVLMoves(pkm, species, 1, pkm.AltForm)); - r.AddRange(getEggMoves(pkm, species, pkm.Species == 678 ? pkm.AltForm : 0)); + + int form = pkm.AltForm; + if (pkm.Format < 6) + form = 0; + if (pkm.Format == 6 && pkm.Species != 678) + form = 0; + + r.AddRange(getEggMoves(pkm, species, form)); r.AddRange(getLVLMoves(pkm, species, 100, pkm.AltForm)); return r.Distinct(); } @@ -190,8 +197,9 @@ internal static IEnumerable getBaseEggMoves(PKM pkm, int skipOption, GameVe case GameVersion.SN: case GameVersion.MN: case GameVersion.SM: + int index = PersonalTable.SM.getFormeIndex(pkm.Species, pkm.AltForm); if (pkm.InhabitedGeneration(7)) - return LevelUpSM[species].getMoves(1); + return LevelUpSM[index].getMoves(1); break; } return null;