mirror of
https://github.com/kwsch/PKHeX
synced 2024-11-24 04:53:08 +00:00
Fix prevo check leveling
current level can be the evolution threshold, so decrement prevo level afterwards.
This commit is contained in:
parent
752b315bb1
commit
623866da06
1 changed files with 4 additions and 5 deletions
|
@ -245,15 +245,14 @@ namespace PKHeX
|
|||
private static IEnumerable<DexLevel> getValidPreEvolutions(PK6 pk6)
|
||||
{
|
||||
var evos = Evolves[pk6.Species].Evos;
|
||||
int dec = 0;
|
||||
List<DexLevel> dl = new List<DexLevel> { new DexLevel { Species = pk6.Species, Level = pk6.CurrentLevel } };
|
||||
int lvl = pk6.CurrentLevel;
|
||||
foreach (DexLevel evo in evos)
|
||||
{
|
||||
if (evo.Level > 0) // Level Up (from previous level)
|
||||
dec++;
|
||||
int lvl = pk6.CurrentLevel - dec;
|
||||
if (lvl >= pk6.Met_Level && lvl > evo.Level)
|
||||
if (lvl >= pk6.Met_Level && lvl <= evo.Level)
|
||||
dl.Add(new DexLevel { Species = evo.Species, Level = lvl });
|
||||
if (evo.Level > 0) // Level Up (from previous level)
|
||||
lvl--;
|
||||
}
|
||||
return dl;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue