From 346a9c9d4f5f29c7cc48a5fd95bc6b18c1ed1988 Mon Sep 17 00:00:00 2001 From: Kurt Date: Thu, 20 Apr 2017 19:51:35 -0700 Subject: [PATCH] Fix evolution invalid check inserted optional param jumped in, resulting in incorrect inputs to the method. Closes #1080 --- PKHeX/Legality/Core.cs | 8 ++++---- PKHeX/Saves/SaveUtil.cs | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/PKHeX/Legality/Core.cs b/PKHeX/Legality/Core.cs index 305290431..dc903ee8b 100644 --- a/PKHeX/Legality/Core.cs +++ b/PKHeX/Legality/Core.cs @@ -1103,7 +1103,7 @@ namespace PKHeX.Core } internal static IEnumerable getG3SpecialEggEncounter(PKM pkm) { - IEnumerable dl = getValidPreEvolutions(pkm,MaxSpeciesID_3); + IEnumerable dl = getValidPreEvolutions(pkm, MaxSpeciesID_3); var sttctable = pkm.E ? EventEgg_G3_Common : pkm.FRLG ? EventEgg_FRLG : EventEgg_RS; var table = sttctable.Where(e => dl.Any(d => d.Species == e.Species)); foreach (EncounterStatic e in table) @@ -2201,7 +2201,7 @@ namespace PKHeX.Core internal static bool getEvolutionValid(PKM pkm) { var curr = getValidPreEvolutions(pkm); - var poss = getValidPreEvolutions(pkm, 100, skipChecks: true); + var poss = getValidPreEvolutions(pkm, lvl: 100, skipChecks: true); if (getSplitBreedGeneration(pkm).Contains(getBaseSpecies(pkm, 1))) return curr.Count() >= poss.Count() - 1; @@ -2852,7 +2852,7 @@ namespace PKHeX.Core private static IEnumerable getSlots(PKM pkm, IEnumerable tables, int lvl = -1) { - IEnumerable vs = getValidPreEvolutions(pkm, lvl); + IEnumerable vs = getValidPreEvolutions(pkm, lvl: lvl); List slotLocations = new List(); foreach (var loc in tables) { @@ -2864,7 +2864,7 @@ namespace PKHeX.Core } return slotLocations; } - private static IEnumerable getValidPreEvolutions(PKM pkm, int maxspeciesorigin =-1, int lvl = -1, bool skipChecks = false) + private static IEnumerable getValidPreEvolutions(PKM pkm, int maxspeciesorigin = -1, int lvl = -1, bool skipChecks = false) { if (lvl < 0) lvl = pkm.CurrentLevel; diff --git a/PKHeX/Saves/SaveUtil.cs b/PKHeX/Saves/SaveUtil.cs index 85bf6d8e1..82047b8d0 100644 --- a/PKHeX/Saves/SaveUtil.cs +++ b/PKHeX/Saves/SaveUtil.cs @@ -433,7 +433,7 @@ namespace PKHeX.Core switch (MC.SelectedGameVersion) { // Side Games - case GameVersion.COLO: sav = new SAV3Colosseum(data,MC); break; + case GameVersion.COLO: sav = new SAV3Colosseum(data, MC); break; case GameVersion.XD: sav = new SAV3XD(data, MC); break; case GameVersion.RSBOX: sav = new SAV3RSBox(data, MC); break;