From 5d74096243bed50be8e763034f18ccfc487b3147 Mon Sep 17 00:00:00 2001 From: Kurt Date: Thu, 30 Nov 2017 22:34:57 -0800 Subject: [PATCH] Apply static/magnet groups by slot type only apply for emerald (only game in gen3 that supports it) --- PKHeX.Core/Legality/Encounters/Data/EncounterUtil.cs | 3 ++- PKHeX.Core/Legality/Encounters/Data/Encounters3.cs | 4 ---- PKHeX.Core/Legality/RNG/Frame/Frame.cs | 3 +-- 3 files changed, 3 insertions(+), 7 deletions(-) diff --git a/PKHeX.Core/Legality/Encounters/Data/EncounterUtil.cs b/PKHeX.Core/Legality/Encounters/Data/EncounterUtil.cs index e3f44ab0c..7e0ec16ec 100644 --- a/PKHeX.Core/Legality/Encounters/Data/EncounterUtil.cs +++ b/PKHeX.Core/Legality/Encounters/Data/EncounterUtil.cs @@ -82,10 +82,11 @@ namespace PKHeX.Core const int steel = (int)MoveType.Steel; const int electric = (int)MoveType.Electric; foreach (EncounterArea Area in Areas) + foreach (var grp in Area.Slots.GroupBy(z => z.Type)) { var s = new List(); // Static var m = new List(); // Magnet Pull - foreach (EncounterSlot Slot in Area.Slots) + foreach (EncounterSlot Slot in grp) { var types = t[Slot.Species].Types; if (types[0] == steel || types[1] == steel) diff --git a/PKHeX.Core/Legality/Encounters/Data/Encounters3.cs b/PKHeX.Core/Legality/Encounters/Data/Encounters3.cs index fc5629a0f..5ae5fefd3 100644 --- a/PKHeX.Core/Legality/Encounters/Data/Encounters3.cs +++ b/PKHeX.Core/Legality/Encounters/Data/Encounters3.cs @@ -48,11 +48,7 @@ namespace PKHeX.Core MarkG3SlotsSafariZones(ref FR_Slots, SafariLocation_FRLG); MarkG3SlotsSafariZones(ref LG_Slots, SafariLocation_FRLG); - MarkEncountersStaticMagnetPull(ref R_Slots, PersonalTable.SM); - MarkEncountersStaticMagnetPull(ref S_Slots, PersonalTable.SM); MarkEncountersStaticMagnetPull(ref E_Slots, PersonalTable.SM); - MarkEncountersStaticMagnetPull(ref FR_Slots, PersonalTable.SM); - MarkEncountersStaticMagnetPull(ref LG_Slots, PersonalTable.SM); SlotsR = AddExtraTableSlots(R_Slots, SlotsRSEAlt); SlotsS = AddExtraTableSlots(S_Slots, SlotsRSEAlt); diff --git a/PKHeX.Core/Legality/RNG/Frame/Frame.cs b/PKHeX.Core/Legality/RNG/Frame/Frame.cs index 130339852..3f30529fe 100644 --- a/PKHeX.Core/Legality/RNG/Frame/Frame.cs +++ b/PKHeX.Core/Legality/RNG/Frame/Frame.cs @@ -36,8 +36,7 @@ // Check Level Now int lvl = SlotRange.GetLevel(slot, Lead, RandLevel); - if (lvl < 0) { } // todo - else if (pkm.HasOriginalMetLocation) + if (pkm.HasOriginalMetLocation) { if (lvl != pkm.Met_Level) return false;