From d0427f0322cb391ea3fe58b4feca082050128f20 Mon Sep 17 00:00:00 2001 From: wwwwwwzx Date: Sun, 26 Mar 2017 20:21:44 -0700 Subject: [PATCH] Fix hgss swarm slots replacement note that dppt only have grass swarm --- PKHeX/Legality/Core.cs | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/PKHeX/Legality/Core.cs b/PKHeX/Legality/Core.cs index c32f6d452..55f2f5c46 100644 --- a/PKHeX/Legality/Core.cs +++ b/PKHeX/Legality/Core.cs @@ -246,15 +246,18 @@ namespace PKHeX.Core } private static void MarkG4SwarmSlots(ref EncounterArea[] Areas, EncounterArea[] SwarmAreas) { - // Swarm slots replace slots 0 and 1 from encounters data + // Grass Swarm slots replace slots 0 and 1 from encounters data + // for surfing only replace slots 0 from encounters data + // for fishing replace one or several random slots from encounters data, but all slots have the same level, it's ok to only replace the first // Species id are not included in encounter tables but levels can be copied from the encounter raw data - foreach(EncounterArea Area in Areas) + foreach (EncounterArea Area in Areas) { var SwarmSlots = SwarmAreas.Where(a => a.Location == Area.Location).SelectMany(s => s.Slots); var OutputSlots = new List(); foreach (EncounterSlot SwarmSlot in SwarmSlots) { - foreach (var swarmSlot in Area.Slots.Where(s => s.Type == SwarmSlot.Type).Take(2).Select(slot => slot.Clone())) + int slotsnum = SwarmSlot.Type == SlotType.Grass ? 2 : 1; + foreach (var swarmSlot in Area.Slots.Where(s => s.Type == SwarmSlot.Type).Take(slotsnum).Select(slot => slot.Clone())) { swarmSlot.Species = SwarmSlot.Species; OutputSlots.Add(swarmSlot);