From 3c4ba0d52b24a038b3f7828d1aab2d96bf289a67 Mon Sep 17 00:00:00 2001 From: Kurt Date: Sun, 22 Jul 2018 17:26:19 -0700 Subject: [PATCH] Misc cleanup --- PKHeX.Core/Legality/Core.cs | 6 +++--- PKHeX.WinForms/Controls/SAV Editor/SAVEditor.cs | 1 - PKHeX.WinForms/Controls/SAV Editor/SlotChangeManager.cs | 2 +- PKHeX.WinForms/Util/QRCoder/QRCode.cs | 4 ++-- 4 files changed, 6 insertions(+), 7 deletions(-) diff --git a/PKHeX.Core/Legality/Core.cs b/PKHeX.Core/Legality/Core.cs index 8a23f1630..592cb221f 100644 --- a/PKHeX.Core/Legality/Core.cs +++ b/PKHeX.Core/Legality/Core.cs @@ -1258,9 +1258,9 @@ internal static bool CanInhabitGen1(this PKM pkm) if (pkm is PK2 pk2 && pk2.CaughtData != 0) return false; int species = pkm.Species; - if (species > MaxSpeciesID_1 && !FutureEvolutionsGen1.Contains(species)) - return false; - return true; + if (species <= MaxSpeciesID_1) + return true; + return !FutureEvolutionsGen1.Contains(species); } public static LanguageID GetSafeLanguage(int generation, LanguageID prefer, GameVersion game = GameVersion.Any) diff --git a/PKHeX.WinForms/Controls/SAV Editor/SAVEditor.cs b/PKHeX.WinForms/Controls/SAV Editor/SAVEditor.cs index d3ada5316..922dc8d15 100644 --- a/PKHeX.WinForms/Controls/SAV Editor/SAVEditor.cs +++ b/PKHeX.WinForms/Controls/SAV Editor/SAVEditor.cs @@ -213,7 +213,6 @@ private void ResetDaycare() if (!SAV.HasDaycare) return; - for (int i = 0; i < 2; i++) { var pb = SlotPictureBoxes[i + (int)SlotIndex.Daycare]; diff --git a/PKHeX.WinForms/Controls/SAV Editor/SlotChangeManager.cs b/PKHeX.WinForms/Controls/SAV Editor/SlotChangeManager.cs index 1cbfe21a5..2021aa02c 100644 --- a/PKHeX.WinForms/Controls/SAV Editor/SlotChangeManager.cs +++ b/PKHeX.WinForms/Controls/SAV Editor/SlotChangeManager.cs @@ -520,11 +520,11 @@ public void SwapBoxes(int index, int other) public void Dispose() { + Sounds.Dispose(); SE?.Dispose(); OriginalBackground?.Dispose(); CurrentBackground?.Dispose(); ColorizedColor?.Dispose(); - Sounds?.Dispose(); } } } diff --git a/PKHeX.WinForms/Util/QRCoder/QRCode.cs b/PKHeX.WinForms/Util/QRCoder/QRCode.cs index bbfda9a94..c0840d24b 100644 --- a/PKHeX.WinForms/Util/QRCoder/QRCode.cs +++ b/PKHeX.WinForms/Util/QRCoder/QRCode.cs @@ -21,9 +21,9 @@ public Bitmap GetGraphic(int pixelsPerModule, Color darkColor, Color lightColor, var bmp = new Bitmap(size, size); var gfx = Graphics.FromImage(bmp); - for (var x = 0; x < size + offset; x = x + pixelsPerModule) + for (var x = 0; x < size + offset; x += pixelsPerModule) { - for (var y = 0; y < size + offset; y = y + pixelsPerModule) + for (var y = 0; y < size + offset; y += pixelsPerModule) { var module = this.QrCodeData.ModuleMatrix[(y + pixelsPerModule)/pixelsPerModule - 1][(x + pixelsPerModule)/pixelsPerModule - 1]; if (module)