From 5ddd59c9aa98fd179af1feb3da8fa2b5991deb75 Mon Sep 17 00:00:00 2001 From: Kurt Date: Sun, 8 Dec 2019 00:03:08 -0800 Subject: [PATCH] Fix runerigus/yamask partial load fail 320 is max hp (31IV 252EV), is this just -60 from max HP (threshold to evolve at?) might need some more research to see what is going on with this only trycatch in release builds; was confused until I stepped thru and saw the crash --- PKHeX.Core/PKM/Util/FormConverter.cs | 10 ++++++++++ PKHeX.WinForms/Controls/PKM Editor/PKMEditor.cs | 4 ++++ 2 files changed, 14 insertions(+) diff --git a/PKHeX.Core/PKM/Util/FormConverter.cs b/PKHeX.Core/PKM/Util/FormConverter.cs index edd8cdb77..1c424bad7 100644 --- a/PKHeX.Core/PKM/Util/FormConverter.cs +++ b/PKHeX.Core/PKM/Util/FormConverter.cs @@ -961,10 +961,20 @@ public static string[] GetFormArgumentStrings(int species, int form, int generat if (generation < 8) return EMPTY; + static string[] GetBlank(int count) + { + var result = new string[count]; + for (int i = 0; i < result.Length; i++) + result[i] = i.ToString(); + return result; + } + return species switch { (int) Furfrou when form != 0 => new[] {"0", "1", "2", "3", "4", "5"}, (int) Hoopa when form == 1 => new[] {"0", "1", "2", "3"}, + (int) Yamask when form == 1 => GetBlank(320), + (int) Runerigus when form == 0 => GetBlank(320), // max Runerigus HP (int) Alcremie => Enum.GetNames(typeof(AlcremieDecoration)), _ => EMPTY }; diff --git a/PKHeX.WinForms/Controls/PKM Editor/PKMEditor.cs b/PKHeX.WinForms/Controls/PKM Editor/PKMEditor.cs index 183b74a79..4fe824439 100644 --- a/PKHeX.WinForms/Controls/PKM Editor/PKMEditor.cs +++ b/PKHeX.WinForms/Controls/PKM Editor/PKMEditor.cs @@ -243,8 +243,12 @@ private void LoadFieldsFromPKM(PKM pk, bool focus = true, bool skipConversionChe Entity = pk.Clone(); +#if !DEBUG try { GetFieldsfromPKM(); } catch { } +#else + GetFieldsfromPKM(); +#endif Stats.UpdateIVs(null, EventArgs.Empty); UpdatePKRSInfected(null, EventArgs.Empty);