From a357c490d8b23de648fb12b3532c4e997da668c6 Mon Sep 17 00:00:00 2001 From: Kurt Date: Thu, 8 Dec 2016 23:06:32 -0800 Subject: [PATCH] Tweak milotic case valid evolution check should check for entire range fix comparison and always return false if beauty insufficient, same as gender below. the trade method passes on skipChecks anyway. --- PKHeX/Legality/Core.cs | 6 +++--- PKHeX/Legality/Structures/EvolutionTree.cs | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/PKHeX/Legality/Core.cs b/PKHeX/Legality/Core.cs index ccc552536..4c28a401a 100644 --- a/PKHeX/Legality/Core.cs +++ b/PKHeX/Legality/Core.cs @@ -533,7 +533,7 @@ internal static bool getIsFossil(PKM pkm) internal static bool getEvolutionValid(PKM pkm) { var curr = getValidPreEvolutions(pkm); - var poss = getValidPreEvolutions(pkm, 100); + var poss = getValidPreEvolutions(pkm, 100, skipChecks: true); if (SplitBreed.Contains(getBaseSpecies(pkm, 1))) return curr.Count() >= poss.Count() - 1; @@ -793,7 +793,7 @@ private static IEnumerable getSlots(PKM pkm, IEnumerable getValidPreEvolutions(PKM pkm, int lvl = -1) + private static IEnumerable getValidPreEvolutions(PKM pkm, int lvl = -1, bool skipChecks = false) { if (lvl < 0) lvl = pkm.CurrentLevel; @@ -805,7 +805,7 @@ private static IEnumerable getValidPreEvolutions(PKM pkm, int lvl = -1 }; var et = getEvolutionTable(pkm); - return et.getValidPreEvolutions(pkm, lvl); + return et.getValidPreEvolutions(pkm, lvl, skipChecks: skipChecks); } private static IEnumerable getStatic(PKM pkm, IEnumerable table, int lvl = -1) { diff --git a/PKHeX/Legality/Structures/EvolutionTree.cs b/PKHeX/Legality/Structures/EvolutionTree.cs index a3e149dbb..48e930cb2 100644 --- a/PKHeX/Legality/Structures/EvolutionTree.cs +++ b/PKHeX/Legality/Structures/EvolutionTree.cs @@ -237,8 +237,8 @@ public bool Valid(PKM pkm, int lvl, bool skipChecks) // Special Levelup Cases case 16: - if (pkm.CNT_Beauty > Argument) - return skipChecks; + if (pkm.CNT_Beauty < Argument) + return false; goto default; case 23: // Gender = Male if (pkm.Gender != 0)