From bdbbe5194e760c42216b7ceeb02ddc5cf6531452 Mon Sep 17 00:00:00 2001 From: Kurt Date: Sat, 30 Jan 2021 10:34:24 -0800 Subject: [PATCH] Update MoveSetApplicator.cs --- PKHeX.Core/Editing/Applicators/MoveSetApplicator.cs | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/PKHeX.Core/Editing/Applicators/MoveSetApplicator.cs b/PKHeX.Core/Editing/Applicators/MoveSetApplicator.cs index d38ab0afc..c923e7a0f 100644 --- a/PKHeX.Core/Editing/Applicators/MoveSetApplicator.cs +++ b/PKHeX.Core/Editing/Applicators/MoveSetApplicator.cs @@ -57,21 +57,23 @@ public static int[] GetMoveSet(this LegalityAnalysis la, bool random = false) /// Fetches based on the provided . /// /// Pokémon to modify. + /// Encounter the relearn moves should be suggested for. If not provided, will try to detect it via legality analysis. /// best suited for the current data. - public static IReadOnlyList GetSuggestedRelearnMoves(this PKM pk) => GetSuggestedRelearnMoves(new LegalityAnalysis(pk)); + public static IReadOnlyList GetSuggestedRelearnMoves(this PKM pk, IEncounterable? enc = null) => GetSuggestedRelearnMoves(new LegalityAnalysis(pk), enc); /// /// Fetches based on the provided . /// /// which contains parsed information pertaining to legality. + /// Encounter the relearn moves should be suggested for. If not provided, will try to detect it via legality analysis. /// best suited for the current data. - public static IReadOnlyList GetSuggestedRelearnMoves(this LegalityAnalysis legal) + public static IReadOnlyList GetSuggestedRelearnMoves(this LegalityAnalysis legal, IEncounterable? enc = null) { var m = legal.GetSuggestedRelearnMovesFromEncounter(); if (m.Any(z => z != 0)) return m; - var enc = legal.EncounterMatch; + enc ??= legal.EncounterMatch; if (enc is MysteryGift || enc is EncounterEgg) return m;