mirror of
https://github.com/kwsch/PKHeX
synced 2024-11-28 06:50:23 +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)
|
private static IEnumerable<DexLevel> getValidPreEvolutions(PK6 pk6)
|
||||||
{
|
{
|
||||||
var evos = Evolves[pk6.Species].Evos;
|
var evos = Evolves[pk6.Species].Evos;
|
||||||
int dec = 0;
|
|
||||||
List<DexLevel> dl = new List<DexLevel> { new DexLevel { Species = pk6.Species, Level = pk6.CurrentLevel } };
|
List<DexLevel> dl = new List<DexLevel> { new DexLevel { Species = pk6.Species, Level = pk6.CurrentLevel } };
|
||||||
|
int lvl = pk6.CurrentLevel;
|
||||||
foreach (DexLevel evo in evos)
|
foreach (DexLevel evo in evos)
|
||||||
{
|
{
|
||||||
if (evo.Level > 0) // Level Up (from previous level)
|
if (lvl >= pk6.Met_Level && lvl <= evo.Level)
|
||||||
dec++;
|
|
||||||
int lvl = pk6.CurrentLevel - dec;
|
|
||||||
if (lvl >= pk6.Met_Level && lvl > evo.Level)
|
|
||||||
dl.Add(new DexLevel { Species = evo.Species, Level = lvl });
|
dl.Add(new DexLevel { Species = evo.Species, Level = lvl });
|
||||||
|
if (evo.Level > 0) // Level Up (from previous level)
|
||||||
|
lvl--;
|
||||||
}
|
}
|
||||||
return dl;
|
return dl;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue