From bd11affa134eb0fbe466e56bfbe3d71e6f1ee4a9 Mon Sep 17 00:00:00 2001 From: Kurt Date: Sun, 30 Aug 2020 19:24:40 -0700 Subject: [PATCH] Minor clean --- PKHeX.WinForms/Subforms/Save Editors/Gen4/SAV_Misc4.cs | 9 ++++++++- PKHeX.WinForms/Subforms/Save Editors/SAV_MailBox.cs | 5 +++-- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/PKHeX.WinForms/Subforms/Save Editors/Gen4/SAV_Misc4.cs b/PKHeX.WinForms/Subforms/Save Editors/Gen4/SAV_Misc4.cs index e11439af3..16ec0281e 100644 --- a/PKHeX.WinForms/Subforms/Save Editors/Gen4/SAV_Misc4.cs +++ b/PKHeX.WinForms/Subforms/Save Editors/Gen4/SAV_Misc4.cs @@ -132,7 +132,14 @@ private void ReadMain() uint valFly = BitConverter.ToUInt32(SAV.General, ofsFly); CLB_FlyDest.Items.Clear(); for (int i = 0; i < FlyDestD.Length; i++) - CLB_FlyDest.Items.Add(metLocationList.First(v => v.Value == FlyDestD[i]).Text, FlyDestC[i] < 32 ? (valFly & 1u << FlyDestC[i]) != 0 : (SAV.General[ofsFly + (FlyDestC[i] >> 3)] & 1 << (FlyDestC[i] & 7)) != 0); + { + var dest = FlyDestD[i]; + var name = metLocationList.First(v => v.Value == dest).Text; + var state = FlyDestC[i] < 32 + ? (valFly & 1u << FlyDestC[i]) != 0 + : (SAV.General[ofsFly + (FlyDestC[i] >> 3)] & 1 << (FlyDestC[i] & 7)) != 0; + CLB_FlyDest.Items.Add(name, state); + } uint valBP = BitConverter.ToUInt16(SAV.General, ofsBP); NUD_BP.Value = valBP > 9999 ? 9999 : valBP; diff --git a/PKHeX.WinForms/Subforms/Save Editors/SAV_MailBox.cs b/PKHeX.WinForms/Subforms/Save Editors/SAV_MailBox.cs index d23e0330d..b14335ba6 100644 --- a/PKHeX.WinForms/Subforms/Save Editors/SAV_MailBox.cs +++ b/PKHeX.WinForms/Subforms/Save Editors/SAV_MailBox.cs @@ -357,9 +357,10 @@ private List CheckValid() } for (int i = 0; i < 6; i++) { - if (heldMailIDs.Count(v => v == i) > 1) //D + var index = i; + if (heldMailIDs.Count(v => v == index) > 1) //D ret.Add($"MailID{i} duplicated"); - if (m[i].IsEmpty == false && heldMailIDs.All(v => v != i)) //E + if (m[i].IsEmpty == false && heldMailIDs.All(v => v != index)) //E ret.Add($"MailID{i} not referred"); } }