From 39a09fbbbef013bcbb475e7d1825836865f92af5 Mon Sep 17 00:00:00 2001 From: Kurt Date: Sun, 5 Jun 2022 11:28:17 -0700 Subject: [PATCH] Defer BDSP->PK8 marsh ball mismatches --- PKHeX.Core/Game/Locations/Locations.cs | 1 + .../Generator/ByGeneration/EncounterGenerator8b.cs | 5 +++++ 2 files changed, 6 insertions(+) diff --git a/PKHeX.Core/Game/Locations/Locations.cs b/PKHeX.Core/Game/Locations/Locations.cs index b3d153eb1..b2a9c9a03 100644 --- a/PKHeX.Core/Game/Locations/Locations.cs +++ b/PKHeX.Core/Game/Locations/Locations.cs @@ -159,6 +159,7 @@ public static class Locations private const int MarshLocation_DPPt = 52; public static bool IsSafariZoneLocation3(int loc) => loc is SafariLocation_RSE or SafariLocation_FRLG; public static bool IsSafariZoneLocation4(int loc) => loc is MarshLocation_DPPt or SafariLocation_HGSS; + public static bool IsSafariZoneLocation8b(int loc) => loc is (>= 219 and <= 224); public static bool IsEggLocationBred4(int loc, GameVersion ver) { diff --git a/PKHeX.Core/Legality/Encounters/Generator/ByGeneration/EncounterGenerator8b.cs b/PKHeX.Core/Legality/Encounters/Generator/ByGeneration/EncounterGenerator8b.cs index 035dad326..8c0d8eca4 100644 --- a/PKHeX.Core/Legality/Encounters/Generator/ByGeneration/EncounterGenerator8b.cs +++ b/PKHeX.Core/Legality/Encounters/Generator/ByGeneration/EncounterGenerator8b.cs @@ -149,9 +149,14 @@ public static IEnumerable GetEncountersFuzzy(PKM pkm, EvoCriteri } } + // Only yield if Safari and Marsh encounters match. + bool safari = pkm is PK8 { Ball: (int)Ball.Safari }; foreach (var z in GetValidWildEncounters(pkm, chain, game)) { + var marsh = Locations.IsSafariZoneLocation8b(z.Location); var match = z.GetMatchRating(pkm); + if (safari != marsh) + match = DeferredErrors; if (match == Match) { yield return z;