Update vc1 invalid transfer pruning

Closes #2065 Thanks @WEERSOQUEER !

Single evo species weren't getting flagged in the evolution verification
as they early returned (species matched), just move the sanity check
before that
This commit is contained in:
Kurt 2018-07-19 16:42:45 -07:00
parent 69e7d49d03
commit 9a91619580
4 changed files with 6 additions and 2 deletions

View file

@ -29,14 +29,14 @@ namespace PKHeX.Core
/// <returns>Evolution is valid or not</returns>
private static bool IsValidEvolution(PKM pkm, LegalInfo info)
{
if (info.EvoChainsAllGens[pkm.Format].Count == 0)
return false; // Can't exist as current species
int species = pkm.Species;
if (info.EncounterMatch.Species == species)
return true;
if (info.EncounterMatch.EggEncounter && species == 350 && pkm.Format >= 5 && !pkm.IsUntraded) // Prism Scale
return true;
if (EvolutionChain.GetEvoChainSpeciesIndex(info.EvoChainsAllGens[pkm.Format], pkm.Species) < 0)
return false; // Can't exist as current species
if (info.Generation > 0 && info.EvoChainsAllGens[info.Generation].All(z => z.Species != info.EncounterMatch.Species))
return false; // Can't exist as origin species

View file

@ -69,7 +69,11 @@ namespace PKHeX.Core
while (mostEvolved.Species > maxspeciesgen)
{
if (queue.Count == 0)
{
if (g <= 2 && pkm.VC1)
GensEvoChains[pkm.Format] = NONE; // invalidate here since we haven't reached the regular invalidation
return GensEvoChains;
}
if (mostEvolved.RequiresLvlUp)
{
// This is a gen 3 pokemon in a gen 4 phase evolution that requires level up and then transfered to gen 5+