Use Current Level instead of Stat Level for pk1/2

Closes #3704
all other impl of LoadStats get CurrentLevel
This commit is contained in:
Kurt 2023-01-21 22:01:30 -08:00
parent 88830e0d00
commit 7b910504ce
2 changed files with 4 additions and 2 deletions

View file

@ -203,7 +203,7 @@ public abstract class GBPKM : PKM
public override void LoadStats(IBaseStat p, Span<ushort> stats)
{
var lv = Stat_Level;
var lv = CurrentLevel; // recalculate instead of checking Stat_Level
stats[0] = (ushort)(GetStat(p.HP, IV_HP, EV_HP, lv) + (5 + lv)); // HP
stats[1] = GetStat(p.ATK, IV_ATK, EV_ATK, lv);
stats[2] = GetStat(p.DEF, IV_DEF, EV_DEF, lv);

View file

@ -389,7 +389,9 @@ public partial class StatEditor : UserControl
{
var pt = MainEditor.RequestSaveFile.Personal;
var pi = pt.GetFormEntry(Entity.Species, Entity.Form);
Entity.SetStats(Entity.GetStats(pi));
Span<ushort> stats = stackalloc ushort[6];
Entity.LoadStats(pi, stats);
Entity.SetStats(stats);
LoadBST(pi);
LoadPartyStats(Entity);
}