From 74a5c03cd2e45068213268fc673b2ef87d525fff Mon Sep 17 00:00:00 2001 From: Kurt Date: Mon, 15 Feb 2021 09:04:47 -0800 Subject: [PATCH] Clean check for overworld IVs Closes #3150 Still need to remove some symbol encounter tables that are unused --- .../Legality/Encounters/EncounterSlot/EncounterSlot8.cs | 4 +++- PKHeX.Core/Legality/RNG/Overworld8RNG.cs | 5 ++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/PKHeX.Core/Legality/Encounters/EncounterSlot/EncounterSlot8.cs b/PKHeX.Core/Legality/Encounters/EncounterSlot/EncounterSlot8.cs index bc982e858..3cfbca993 100644 --- a/PKHeX.Core/Legality/Encounters/EncounterSlot/EncounterSlot8.cs +++ b/PKHeX.Core/Legality/Encounters/EncounterSlot/EncounterSlot8.cs @@ -52,7 +52,9 @@ public OverworldCorrelation8Requirement GetRequirement(PKM pk) public bool IsOverworldCorrelationCorrect(PKM pk) { - return Overworld8RNG.ValidateOverworldEncounter(pk); + var area = (EncounterArea8) Area; + var flawless = area.PermitCrossover ? -1 : 0; + return Overworld8RNG.ValidateOverworldEncounter(pk, flawless: flawless); } public override EncounterMatchRating GetMatchRating(PKM pkm) diff --git a/PKHeX.Core/Legality/RNG/Overworld8RNG.cs b/PKHeX.Core/Legality/RNG/Overworld8RNG.cs index 5fe2c21fa..55eaf6c21 100644 --- a/PKHeX.Core/Legality/RNG/Overworld8RNG.cs +++ b/PKHeX.Core/Legality/RNG/Overworld8RNG.cs @@ -175,9 +175,8 @@ private static bool IsValidSequence(PKM pk, int[] template, ref Xoroshiro128Plus { for (int i = 0; i < 6; i++) { - if (template[i] != UNSET) - continue; - var expect = (int) rng.NextInt(32); + var temp = template[i]; + var expect = temp == UNSET ? (int)rng.NextInt(32) : temp; var actual = i switch { 0 => pk.IV_HP,