Update EncounterGenerator6.cs

Closes #3153
wc6 is the only one with deferred cards that matter
This commit is contained in:
Kurt 2021-02-16 07:35:55 -08:00
parent f63654d5ae
commit f5b47f9116

View file

@ -16,11 +16,33 @@ namespace PKHeX.Core
int ctr = 0;
var chain = EncounterOrigin.GetOriginChain(pkm);
IEncounterable? deferred = null;
IEncounterable? partial = null;
if (pkm.WasEvent || pkm.WasEventEgg || pkm.WasLink)
{
foreach (var z in GetValidGifts(pkm, chain))
{ yield return z; ++ctr; }
if (ctr != 0) yield break;
{
var match = z.GetMatchRating(pkm);
switch (match)
{
case Match: yield return z; ++ctr; break;
case Deferred: deferred ??= z; break;
case PartialMatch: partial ??= z; break;
}
}
if (ctr != 0)
{
if (deferred != null)
yield return deferred;
if (partial != null)
yield return partial;
}
yield break;
}
if (pkm.WasBredEgg)
@ -30,9 +52,6 @@ namespace PKHeX.Core
if (ctr == 0) yield break;
}
IEncounterable? deferred = null;
IEncounterable? partial = null;
foreach (var z in GetValidStaticEncounter(pkm, chain))
{
var match = z.GetMatchRating(pkm);