From 19cb2cda2e5c31befe2738bab5c51702c8dc76a2 Mon Sep 17 00:00:00 2001 From: Kurt Date: Sun, 10 Jun 2018 12:27:53 -0700 Subject: [PATCH] Remove MAX giveRegular for ORAS level 3 is the legitimate max --- PKHeX.Core/Saves/Substructures/OPower/OPower6.cs | 15 ++++++++------- .../Subforms/Save Editors/Gen6/SAV_OPower.cs | 1 - 2 files changed, 8 insertions(+), 8 deletions(-) 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;