From 7b910504cecd2c4dc28ec2b4e8b6abee970f1b7b Mon Sep 17 00:00:00 2001 From: Kurt Date: Sat, 21 Jan 2023 22:01:30 -0800 Subject: [PATCH] Use Current Level instead of Stat Level for pk1/2 Closes #3704 all other impl of LoadStats get CurrentLevel --- PKHeX.Core/PKM/Shared/GBPKM.cs | 2 +- PKHeX.WinForms/Controls/PKM Editor/StatEditor.cs | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/PKHeX.Core/PKM/Shared/GBPKM.cs b/PKHeX.Core/PKM/Shared/GBPKM.cs index 05dcd3a32..20ad9079c 100644 --- a/PKHeX.Core/PKM/Shared/GBPKM.cs +++ b/PKHeX.Core/PKM/Shared/GBPKM.cs @@ -203,7 +203,7 @@ protected int TransferLanguage(int destLanguage) public override void LoadStats(IBaseStat p, Span 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); diff --git a/PKHeX.WinForms/Controls/PKM Editor/StatEditor.cs b/PKHeX.WinForms/Controls/PKM Editor/StatEditor.cs index 19a7c3ac2..074c1731f 100644 --- a/PKHeX.WinForms/Controls/PKM Editor/StatEditor.cs +++ b/PKHeX.WinForms/Controls/PKM Editor/StatEditor.cs @@ -389,7 +389,9 @@ public void UpdateStats() { var pt = MainEditor.RequestSaveFile.Personal; var pi = pt.GetFormEntry(Entity.Species, Entity.Form); - Entity.SetStats(Entity.GetStats(pi)); + Span stats = stackalloc ushort[6]; + Entity.LoadStats(pi, stats); + Entity.SetStats(stats); LoadBST(pi); LoadPartyStats(Entity); }