From e12f3004ad4b520a32bf68ced59a8212d9738c49 Mon Sep 17 00:00:00 2001 From: Kurt Date: Mon, 7 Feb 2022 18:44:29 -0800 Subject: [PATCH] Post-check defer if catchrate disallows tradeback Closes #3412 --- PKHeX.Core/Legality/Encounters/Generator/EncounterFinder.cs | 5 +++++ PKHeX.Core/PKM/PK1.cs | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/PKHeX.Core/Legality/Encounters/Generator/EncounterFinder.cs b/PKHeX.Core/Legality/Encounters/Generator/EncounterFinder.cs index c543f43e7c2..ade1348affb 100644 --- a/PKHeX.Core/Legality/Encounters/Generator/EncounterFinder.cs +++ b/PKHeX.Core/Legality/Encounters/Generator/EncounterFinder.cs @@ -126,6 +126,11 @@ private static bool VerifySecondaryChecks(PKM pkm, LegalInfo info, PeekEnumerato return false; } } + else if (pkm is PK1 pk1) + { + if (info.Moves.Any(z => z.Generation is not 1) && !PK1.IsCatchRateHeldItem(pk1.Catch_Rate)) + return false; + } info.Parse.Add(evo); return true; diff --git a/PKHeX.Core/PKM/PK1.cs b/PKHeX.Core/PKM/PK1.cs index 6bd8ba09d06..e67790f1ef1 100644 --- a/PKHeX.Core/PKM/PK1.cs +++ b/PKHeX.Core/PKM/PK1.cs @@ -80,7 +80,7 @@ public override PKM Clone() public override int Stat_SPD { get => Stat_SPC; set { } } #endregion - private static bool IsCatchRateHeldItem(int rate) => ParseSettings.AllowGen1Tradeback && Array.IndexOf(Legal.HeldItems_GSC, (ushort)rate) >= 0; + public static bool IsCatchRateHeldItem(int rate) => ParseSettings.AllowGen1Tradeback && Array.IndexOf(Legal.HeldItems_GSC, (ushort)rate) >= 0; private static bool IsCatchRatePreEvolutionRate(int baseSpecies, int finalSpecies, int rate) {