Post-check defer if catchrate disallows tradeback

Closes #3412
This commit is contained in:
Kurt
2022-02-07 18:44:29 -08:00
parent a7051107ea
commit e12f3004ad
2 changed files with 6 additions and 1 deletions

View File

@@ -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;

View File

@@ -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)
{