mirror of
https://github.com/kwsch/PKHeX.git
synced 2026-05-13 23:50:25 -05:00
Minor tweaks
This commit is contained in:
parent
83c61a2515
commit
d61e646ca9
|
|
@ -41,9 +41,9 @@ public static IEnumerable<IEncounterable> GetEncounters(PKM pkm)
|
|||
|
||||
if (partial != null)
|
||||
yield return partial;
|
||||
}
|
||||
|
||||
yield break;
|
||||
yield break;
|
||||
}
|
||||
}
|
||||
|
||||
if (pkm.WasBredEgg)
|
||||
|
|
|
|||
|
|
@ -1,6 +1,5 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using static PKHeX.Core.Species;
|
||||
|
||||
namespace PKHeX.Core
|
||||
|
|
@ -77,20 +76,16 @@ private static IReadOnlyList<EvoCriteria> GetOriginChain(PKM pkm, int maxSpecies
|
|||
var tempMax = pkm.CurrentLevel;
|
||||
var chain = EvolutionChain.GetValidPreEvolutions(pkm, maxSpecies, tempMax, minLevel);
|
||||
|
||||
for (int i = chain.Count - 1; i >= 0; i--)
|
||||
foreach (var evo in chain)
|
||||
{
|
||||
var evo = chain[i];
|
||||
if (evo.MinLevel > maxLevel)
|
||||
{
|
||||
chain.RemoveAt(i);
|
||||
if (chain.Any(z => z.Level >= maxLevel))
|
||||
continue;
|
||||
chain.Clear();
|
||||
break;
|
||||
}
|
||||
|
||||
// Check for invalid evolutions, or cases where they may be under-leveled encounters of an evolution.
|
||||
if (evo.Level > maxLevel)
|
||||
evo.Level = maxLevel;
|
||||
if (evo.MinLevel <= maxLevel)
|
||||
continue;
|
||||
evo.MinLevel = maxLevel;
|
||||
if (evo.RequiresLvlUp)
|
||||
maxLevel--;
|
||||
}
|
||||
return chain;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user