From 1db41c8b21d4733e3ecaff5a2802eeac7d79c6b6 Mon Sep 17 00:00:00 2001 From: Kurt Date: Wed, 20 Jun 2018 21:43:54 -0700 Subject: [PATCH] Add vc2 evo chain check queue should be checking against none left rather than any left. Add test cases --- PKHeX.Core/Legality/Evolutions/EvolutionChain.cs | 4 ++-- .../Generation 2/251 - Celebi - FDB063C95344.pk7 | Bin 0 -> 232 bytes .../Legal/Generation 2/251_-_CELEBI_-_1EE8.pk2 | Bin 0 -> 73 bytes 3 files changed, 2 insertions(+), 2 deletions(-) create mode 100644 Tests/PKHeX.Tests/Legality/Legal/Generation 2/251 - Celebi - FDB063C95344.pk7 create mode 100644 Tests/PKHeX.Tests/Legality/Legal/Generation 2/251_-_CELEBI_-_1EE8.pk2 diff --git a/PKHeX.Core/Legality/Evolutions/EvolutionChain.cs b/PKHeX.Core/Legality/Evolutions/EvolutionChain.cs index defa89dee..8f9091252 100644 --- a/PKHeX.Core/Legality/Evolutions/EvolutionChain.cs +++ b/PKHeX.Core/Legality/Evolutions/EvolutionChain.cs @@ -67,7 +67,7 @@ private static EvoCriteria[][] GetChainAll(PKM pkm, IEncounterable Encounter, IE // If the pokemon origin is illegal (e.g. Gen3 Infernape) the list will be emptied -- species lineage did not exist at any evolution stage. while (mostEvolved.Species > maxspeciesgen) { - if (queue.Count == 1) + if (queue.Count == 0) return GensEvoChains; if (mostEvolved.RequiresLvlUp) { @@ -93,7 +93,7 @@ private static EvoCriteria[][] GetChainAll(PKM pkm, IEncounterable Encounter, IE { if (g < 7 && pkm.Format >= 7 && mostEvolved.Form > 0) { - if (queue.Count == 1) + if (queue.Count == 0) break; mostEvolved = queue.Dequeue(); } diff --git a/Tests/PKHeX.Tests/Legality/Legal/Generation 2/251 - Celebi - FDB063C95344.pk7 b/Tests/PKHeX.Tests/Legality/Legal/Generation 2/251 - Celebi - FDB063C95344.pk7 new file mode 100644 index 0000000000000000000000000000000000000000..c659db26e8357dcc0fdbd0414eb5e640e80cbcd0 GIT binary patch literal 232 zcmZ<>KAFtGu;K4-1_p*1AR?53L5`7ufqBxWJzT6nJ^|p&kjjt)#7PX9XezHW+-CU3 z@PmO>l9eA->i^^a_5lpu3?4vz5vWoi9wWOUvS11WBMUQJAc!HK!5Pj&W~9J5LTn;H Rwqq%a9D}AIJ0lZF0sx@R7Z3md literal 0 HcmV?d00001 diff --git a/Tests/PKHeX.Tests/Legality/Legal/Generation 2/251_-_CELEBI_-_1EE8.pk2 b/Tests/PKHeX.Tests/Legality/Legal/Generation 2/251_-_CELEBI_-_1EE8.pk2 new file mode 100644 index 0000000000000000000000000000000000000000..193563ce675c14503ac2b21295026f6956aedb67 GIT binary patch literal 73 zcmZSl{r@+^_1oWm{GP!O%76g84Xl!^{B8{M_~a0R5Z1(XO#x7`rk3uO#*P3G007kn B5e)zU literal 0 HcmV?d00001