diff --git a/PKHeX.Core/Legality/Encounters/Data/Encounters8.cs b/PKHeX.Core/Legality/Encounters/Data/Encounters8.cs index 9c0caabd9..b12adad8b 100644 --- a/PKHeX.Core/Legality/Encounters/Data/Encounters8.cs +++ b/PKHeX.Core/Legality/Encounters/Data/Encounters8.cs @@ -26,8 +26,10 @@ static Encounters8() StaticSW = GetStaticEncounters(Encounter_SWSH, SW); StaticSH = GetStaticEncounters(Encounter_SWSH, SH); - StaticSW = ArrayUtil.ConcatAll(StaticSW, Nest_Common, Nest_SW, GetStaticEncounters(Crystal_SWSH, SW)); - StaticSH = ArrayUtil.ConcatAll(StaticSH, Nest_Common, Nest_SH, GetStaticEncounters(Crystal_SWSH, SH)); + + // Include Nest Tables for both versions -- online play can share them across versions! In the IsMatch method we check if it's a valid share. + StaticSW = ArrayUtil.ConcatAll(StaticSW, Nest_Common, Nest_SW, Nest_SH, GetStaticEncounters(Crystal_SWSH, SW)); + StaticSH = ArrayUtil.ConcatAll(StaticSH, Nest_Common, Nest_SW, Nest_SH, GetStaticEncounters(Crystal_SWSH, SH)); MarkEncountersGeneration(8, SlotsSW, SlotsSH); MarkEncountersGeneration(8, StaticSW, StaticSH, TradeGift_SWSH); diff --git a/PKHeX.Core/Legality/Encounters/Data/Encounters8Nest.cs b/PKHeX.Core/Legality/Encounters/Data/Encounters8Nest.cs index efa2a4d05..da9de8c90 100644 --- a/PKHeX.Core/Legality/Encounters/Data/Encounters8Nest.cs +++ b/PKHeX.Core/Legality/Encounters/Data/Encounters8Nest.cs @@ -100,7 +100,7 @@ internal static class Encounters8Nest private const byte Nest91 = 91; private const byte Nest92 = 92; - internal static IReadOnlyList> NestLocations = new [] + internal static readonly IReadOnlyList> NestLocations = new [] { new byte[] {144, 134, 122}, // 00 : Stony Wilderness, South Lake Miloch, Rolling Fields new byte[] {144, 126}, // 01 : Stony Wilderness, Watchtower Ruins @@ -196,10 +196,10 @@ internal static class Encounters8Nest new byte[] {142, 124}, // 91 : Bridge Field, Dappled Grove new byte[] {146}, // 92 : Dusty Bowl }; - + // Abilities Allowed internal const int A3 = 0; // 1/2 only - internal const int A4 = -1; // 1/2/H + private const int A4 = -1; // 1/2/H internal static readonly EncounterStatic8N[] Nest_Common = { diff --git a/PKHeX.Core/Legality/Encounters/EncounterStatic8N.cs b/PKHeX.Core/Legality/Encounters/EncounterStatic8N.cs index 9bae2f850..5b931e565 100644 --- a/PKHeX.Core/Legality/Encounters/EncounterStatic8N.cs +++ b/PKHeX.Core/Legality/Encounters/EncounterStatic8N.cs @@ -55,7 +55,7 @@ protected override bool IsMatchLevel(PKM pkm, int lvl) protected override bool IsMatchLocation(PKM pkm) { var loc = pkm.Met_Location; - return loc == OnlineNest || loc <= 255 && NestLocations.Contains((byte)loc); + return loc == OnlineNest || (loc <= 255 && NestLocations.Contains((byte)loc)); } public override bool IsMatch(PKM pkm, int lvl) @@ -66,6 +66,9 @@ public override bool IsMatch(PKM pkm, int lvl) if (pkm.FlawlessIVCount < MinRank + 1) return false; + if (Version != GameVersion.SWSH && pkm.Version != (int) Version && pkm.Met_Location != OnlineNest) + return false; + return base.IsMatch(pkm, lvl); } @@ -74,7 +77,7 @@ public override bool IsMatchDeferred(PKM pkm) if (base.IsMatchDeferred(pkm)) return true; if (Ability == Encounters8Nest.A3 && pkm.AbilityNumber == 4) - return false; + return true; if (pkm is IGigantamax g && g.CanGigantamax != CanGigantamax) return true;