Handle max possible level for transferred & evolved-to-new-species

A Gen3 level 26 sylveon with a met level of 25 in Generation 8:
Transferred as Eevee at level 25, and leveled up to 26=>Sylveon
If we use met_level (25), we need to decrease 1 as we evolve. No, use Current Level and ensure the max isn't above the bare minimum (met level)
This commit is contained in:
Kurt 2020-10-08 15:35:50 -07:00
parent 804b85ea33
commit 7cb484834c

View file

@ -118,7 +118,8 @@ namespace PKHeX.Core
if (generation >= 4)
return met;
return GetLevelOriginMaxTransfer(pkm, met, generation);
var downLevel = GetLevelOriginMaxTransfer(pkm, pkm.CurrentLevel, generation);
return Math.Min(met, downLevel);
}
private static int GetLevelOriginMaxTransfer(PKM pkm, int met, int generation)