diff --git a/PKHeX.Core/Saves/Substructures/OPower/OPower6.cs b/PKHeX.Core/Saves/Substructures/OPower/OPower6.cs index 8932d93a0..79dbe9dcf 100644 --- a/PKHeX.Core/Saves/Substructures/OPower/OPower6.cs +++ b/PKHeX.Core/Saves/Substructures/OPower/OPower6.cs @@ -69,9 +69,9 @@ public bool MasterFlag } public void UnlockAll() => ToggleFlags(allEvents: true); - public void UnlockRegular(bool ORAS) => ToggleFlags(ORAS: ORAS); + public void UnlockRegular(bool ORAS) => ToggleFlags(); public void ClearAll() => ToggleFlags(clearOnly: true); - private void ToggleFlags(bool allEvents = false, bool clearOnly = false, bool ORAS = false) + private void ToggleFlags(bool allEvents = false, bool clearOnly = false) { foreach (var m in Mapping) { @@ -83,12 +83,13 @@ private void ToggleFlags(bool allEvents = false, bool clearOnly = false, bool OR if (clearOnly) continue; - int lvl = ORAS || allEvents ? m.BaseCount : (m.BaseCount != 1 ? 3 : 0); // Full_Recovery is ORAS/event only @ 1 level + int lvl = allEvents ? m.BaseCount : (m.BaseCount != 1 ? 3 : 0); // Full_Recovery is ORAS/event only @ 1 level m.SetOPowerLevel(Data, Offset, lvl); - if (allEvents) - m.SetOPowerS(Data, Offset, true); - if (ORAS || allEvents) - m.SetOPowerMAX(Data, Offset, true); + if (!allEvents) + continue; + + m.SetOPowerS(Data, Offset, true); + m.SetOPowerMAX(Data, Offset, true); } } diff --git a/PKHeX.WinForms/Subforms/Save Editors/Gen6/SAV_OPower.cs b/PKHeX.WinForms/Subforms/Save Editors/Gen6/SAV_OPower.cs index 47702f2d8..5593000c8 100644 --- a/PKHeX.WinForms/Subforms/Save Editors/Gen6/SAV_OPower.cs +++ b/PKHeX.WinForms/Subforms/Save Editors/Gen6/SAV_OPower.cs @@ -1,5 +1,4 @@ using System; -using System.Linq; using System.Windows.Forms; using PKHeX.Core;