From dd7684735a0115fc9e927b12864cf99f097c729a Mon Sep 17 00:00:00 2001 From: Kurt Date: Tue, 28 Nov 2017 21:30:53 -0800 Subject: [PATCH] Add Frame mismatch illegal message handling encounter will no longer be ignored as valid, will instead show the RNG frame mismatch message. --- PKHeX.Core/Legality/Encounters/EncounterFinder.cs | 2 ++ PKHeX.Core/Legality/Encounters/EncounterGenerator.cs | 6 ++++++ PKHeX.Core/Legality/Encounters/LegalInfo.cs | 6 +++++- 3 files changed, 13 insertions(+), 1 deletion(-) diff --git a/PKHeX.Core/Legality/Encounters/EncounterFinder.cs b/PKHeX.Core/Legality/Encounters/EncounterFinder.cs index 3264b4419..8a1ea3555 100644 --- a/PKHeX.Core/Legality/Encounters/EncounterFinder.cs +++ b/PKHeX.Core/Legality/Encounters/EncounterFinder.cs @@ -46,6 +46,8 @@ namespace PKHeX.Core break; // passes } + if (!info.FrameMatches && info.EncounterMatch is EncounterSlot) // if false, all valid RNG frame matches have already been consumed + info.Parse.Add(new CheckResult(Severity.Invalid, V400, CheckIdentifier.PID)); if (!info.PIDIVMatches) // if false, all valid PIDIV matches have already been consumed info.Parse.Add(new CheckResult(Severity.Invalid, V411, CheckIdentifier.PID)); diff --git a/PKHeX.Core/Legality/Encounters/EncounterGenerator.cs b/PKHeX.Core/Legality/Encounters/EncounterGenerator.cs index 122175437..b47429801 100644 --- a/PKHeX.Core/Legality/Encounters/EncounterGenerator.cs +++ b/PKHeX.Core/Legality/Encounters/EncounterGenerator.cs @@ -297,7 +297,10 @@ namespace PKHeX.Core { if (slots.Any(s => s.EncounterSlot(z.Type, z) == z.SlotNumber)) yield return z; + else + deferred.Add(z); } + info.FrameMatches = false; // do static encounters if they were deferred to end, spit out any possible encounters for invalid pkm if (safariSport) @@ -328,7 +331,10 @@ namespace PKHeX.Core { if (slots.Any(s => s.EncounterSlot(z.Type, z) == z.SlotNumber)) yield return z; + else + deferred.Add(z); } + info.FrameMatches = false; if (pkm.Version != 15) // no eggs in C/XD foreach (var z in GenerateEggs(pkm)) diff --git a/PKHeX.Core/Legality/Encounters/LegalInfo.cs b/PKHeX.Core/Legality/Encounters/LegalInfo.cs index 2e80afb54..39b82222a 100644 --- a/PKHeX.Core/Legality/Encounters/LegalInfo.cs +++ b/PKHeX.Core/Legality/Encounters/LegalInfo.cs @@ -51,9 +51,13 @@ namespace PKHeX.Core public PIDIV PIDIV { get; set; } /// Indicates whether or not the can originate from the . - /// This boolean is true until all valid encounters are tested, at which time it is false. + /// This boolean is true until all valid encounters are tested, after which it is false. public bool PIDIVMatches { get; set; } = true; + /// Indicates whether or not the can originate from the with explicit matching. + /// This boolean is true until all valid entries are tested for all possible matches, after which it is false. + public bool FrameMatches { get; set; } = true; + public readonly bool Korean; public LegalInfo(PKM pk)