From c44f596e081477d9114ddc36e64f1bc04af9ae1f Mon Sep 17 00:00:00 2001 From: Kaphotics Date: Mon, 9 May 2016 20:58:12 -0700 Subject: [PATCH] Fix Egg evolution lineage check If [i]'s evolution chain has (species), add i to list. Previously it only looked downward (metapod -> caterpie), now with this it looks upward (beedrill <- metapod) Thanks nymeros! --- Legality/Core.cs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/Legality/Core.cs b/Legality/Core.cs index 2dc4043ce..99dbc33e6 100644 --- a/Legality/Core.cs +++ b/Legality/Core.cs @@ -316,7 +316,11 @@ internal static bool getEvolutionValid(PK6 pk6) } internal static IEnumerable getLineage(PK6 pk6) { - List res = new List(); + int species = pk6.Species; + List res = new List{species}; + for (int i = 0; i < Evolves.Length; i++) + if (Evolves[i].Evos.Any(pk => pk.Species == species)) + res.Add(i); for (int i = -1; i < 2; i++) res.Add(getBaseSpecies(pk6, i)); return res.Distinct();