mirror of
https://github.com/kwsch/PKHeX
synced 2024-11-27 06:20:25 +00:00
Improve partial match bleed through
Checks partial matches in the loop rather than outside; it'll only settle on the partial match if there's nothing else to settle on. Gen1/2 generators can have partial matches bubble up before actual matches (gen1 fighting gen2).
This commit is contained in:
parent
2b00e310ae
commit
9d9eb935b1
1 changed files with 14 additions and 8 deletions
|
@ -41,16 +41,22 @@ namespace PKHeX.Core
|
|||
}
|
||||
info.Parse.Add(e);
|
||||
|
||||
if (VerifySecondaryChecks(pkm, info, encounter))
|
||||
break; // passes
|
||||
}
|
||||
if (!VerifySecondaryChecks(pkm, info, encounter))
|
||||
continue;
|
||||
|
||||
// Sanity Check -- Some secondary checks might not be as thorough as the partial-match leak-through checks done by the encounter.
|
||||
if (info.EncounterMatch is not IEncounterMatch mx)
|
||||
break;
|
||||
|
||||
// Sanity Check -- Some secondary checks might not be as thorough as the partial-match leak-through checks done by the encounter.
|
||||
if (info.EncounterMatch is IEncounterMatch mx)
|
||||
{
|
||||
var match = mx.GetMatchRating(pkm);
|
||||
if (match == EncounterMatchRating.PartialMatch)
|
||||
info.Parse.Add( new CheckResult(Severity.Invalid, LEncInvalid, CheckIdentifier.Encounter));
|
||||
if (match != EncounterMatchRating.PartialMatch)
|
||||
break;
|
||||
|
||||
if (encounter.PeekIsNext())
|
||||
continue;
|
||||
|
||||
info.Parse.Add(new CheckResult(Severity.Invalid, LEncInvalid, CheckIdentifier.Encounter));
|
||||
break;
|
||||
}
|
||||
|
||||
if (!info.FrameMatches && info.EncounterMatch is EncounterSlot {Version: not GameVersion.CXD}) // if false, all valid RNG frame matches have already been consumed
|
||||
|
|
Loading…
Reference in a new issue