From 7c8f52cbbfefedd9c10187c98a69d15418b3a1a1 Mon Sep 17 00:00:00 2001 From: Kurt Date: Mon, 2 May 2022 23:48:25 -0700 Subject: [PATCH] Minor clean invert nesting, add missing if( space, group OT checks together --- .../Bulk/Suggestion/BatchModifications.cs | 35 +++++++++---------- .../EncounterSlot/EncounterSlot8.cs | 2 +- .../Legality/Verifiers/TrainerNameVerifier.cs | 5 +-- .../Subforms/PKM Editors/BatchEditor.cs | 2 +- 4 files changed, 22 insertions(+), 22 deletions(-) diff --git a/PKHeX.Core/Editing/Bulk/Suggestion/BatchModifications.cs b/PKHeX.Core/Editing/Bulk/Suggestion/BatchModifications.cs index f9b8568ef..4a5112908 100644 --- a/PKHeX.Core/Editing/Bulk/Suggestion/BatchModifications.cs +++ b/PKHeX.Core/Editing/Bulk/Suggestion/BatchModifications.cs @@ -30,26 +30,25 @@ namespace PKHeX.Core public static ModifyResult SetSuggestedMasteryData(BatchInfo info, string propValue) { var pk = info.Entity; - if (pk is IMoveShop8Mastery t) + if (pk is not IMoveShop8Mastery t) + return ModifyResult.Invalid; + + if (IsAll(propValue)) { - if (IsAll(propValue)) - { - t.SetMoveShopFlags(); - t.SetMoveShopFlagsMastered(); - } - else if (!IsNone(propValue)) - { - // whatever fit the current moves - t.SetMoveShopFlags(pk.Moves); - t.SetMoveShopFlagsMastered(); - } - else - { - t.ClearMoveShopFlags(); - } - return ModifyResult.Modified; + t.SetMoveShopFlags(); + t.SetMoveShopFlagsMastered(); } - return ModifyResult.Invalid; + else if (!IsNone(propValue)) + { + // whatever fit the current moves + t.SetMoveShopFlags(pk.Moves); + t.SetMoveShopFlagsMastered(); + } + else + { + t.ClearMoveShopFlags(); + } + return ModifyResult.Modified; } public static ModifyResult SetSuggestedRibbons(BatchInfo info, string value) diff --git a/PKHeX.Core/Legality/Encounters/EncounterSlot/EncounterSlot8.cs b/PKHeX.Core/Legality/Encounters/EncounterSlot/EncounterSlot8.cs index 79ef323ea..7e75f204c 100644 --- a/PKHeX.Core/Legality/Encounters/EncounterSlot/EncounterSlot8.cs +++ b/PKHeX.Core/Legality/Encounters/EncounterSlot/EncounterSlot8.cs @@ -122,7 +122,7 @@ namespace PKHeX.Core return EncounterMatchRating.DeferredErrors; // Galar Mine hidden encounters can only be found via Curry or Fishing. - if(Location is (30 or 54) && SlotType is AreaSlotType8.HiddenMain && !m.RibbonMarkCurry && !SlotType.CanEncounterViaFishing(Weather)) + if (Location is (30 or 54) && SlotType is AreaSlotType8.HiddenMain && !m.RibbonMarkCurry && !SlotType.CanEncounterViaFishing(Weather)) return EncounterMatchRating.DeferredErrors; } diff --git a/PKHeX.Core/Legality/Verifiers/TrainerNameVerifier.cs b/PKHeX.Core/Legality/Verifiers/TrainerNameVerifier.cs index 9f0f50ebc..e52dca409 100644 --- a/PKHeX.Core/Legality/Verifiers/TrainerNameVerifier.cs +++ b/PKHeX.Core/Legality/Verifiers/TrainerNameVerifier.cs @@ -46,10 +46,11 @@ namespace PKHeX.Core { if (WordFilter.IsFiltered(ot, out string bad)) data.AddLine(GetInvalid($"Wordfilter: {bad}")); - if (WordFilter.IsFiltered(pkm.HT_Name, out bad)) - data.AddLine(GetInvalid($"Wordfilter: {bad}")); if (ContainsTooManyNumbers(ot, data.Info.Generation)) data.AddLine(GetInvalid("Wordfilter: Too many numbers.")); + + if (WordFilter.IsFiltered(pkm.HT_Name, out bad)) + data.AddLine(GetInvalid($"Wordfilter: {bad}")); } } diff --git a/PKHeX.WinForms/Subforms/PKM Editors/BatchEditor.cs b/PKHeX.WinForms/Subforms/PKM Editors/BatchEditor.cs index d417d68a3..6eaaa2ab8 100644 --- a/PKHeX.WinForms/Subforms/PKM Editors/BatchEditor.cs +++ b/PKHeX.WinForms/Subforms/PKM Editors/BatchEditor.cs @@ -264,7 +264,7 @@ namespace PKHeX.WinForms if (entry.Source is SlotInfoBox info && SAV.GetSlotFlags(info.Box, info.Slot).IsOverwriteProtected()) editor.AddSkipped(); - else if(!BatchEditing.IsFilterMatchMeta(filterMeta, entry)) + else if (!BatchEditing.IsFilterMatchMeta(filterMeta, entry)) editor.AddSkipped(); else editor.Process(pk, Filters, Instructions);