Flag cross-transfer presence if tracker missing

Can't get a Pioneer Ribbon on SW/SH alolan vulpix lacking a HOME Tracker, assuming you have the HOME Tracker setting enabled.
This commit is contained in:
Kurt 2022-08-16 15:50:35 -07:00
parent 912023d756
commit 136f742299
3 changed files with 29 additions and 3 deletions

View File

@ -37,14 +37,38 @@ public bool Append(PKM pk, EvolutionHistory history, ref ReadOnlySpan<EvoCriteri
// Block BD/SP transfers that are impossible
BlockBDSP(history, enc);
if (!pk.IsUntraded)
if (!pk.IsUntraded && !(ParseSettings.IgnoreTransferIfNoTracker && pk is IHomeTrack { Tracker: 0 }))
{
CrossPropagate(history);
}
else
{
DeleteAdjacent(pk, history);
if (!HasVisited(history))
return false;
}
chain = GetMaxChain(history);
return chain.Length != 0;
}
private static bool HasVisited(EvolutionHistory history)
{
return history.Gen8.Length != 0 || history.Gen8a.Length != 0 || history.Gen8b.Length != 0;
}
private static void DeleteAdjacent(PKM pk, EvolutionHistory history)
{
if (pk is not PK8)
history.Gen8 = Array.Empty<EvoCriteria>();
if (pk is not PA8)
history.Gen8a = Array.Empty<EvoCriteria>();
if (pk is not PB8)
history.Gen8b = Array.Empty<EvoCriteria>();
}
private static void BlockBDSP(EvolutionHistory history, EvolutionOrigin enc)
{
var bdsp = history.Gen8b;

View File

@ -7,7 +7,7 @@ namespace PKHeX.Core;
// ReSharper disable once NotAccessedPositionalProperty.Global
public sealed record CheckResult(Severity Judgement, string Comment, CheckIdentifier Identifier)
{
public bool Valid => Judgement >= Severity.Fishy;
public bool Valid => Judgement != Severity.Invalid;
public string Rating => Judgement.Description();
internal CheckResult(CheckIdentifier i) : this(Severity.Valid, LegalityCheckStrings.L_AValid, i) { }

View File

@ -1,4 +1,4 @@
using System.Collections.Generic;
using System.Collections.Generic;
using System.Linq;
namespace PKHeX.Core;
@ -87,6 +87,8 @@ public static bool InitFromSaveFileData(SaveFile sav)
};
}
internal static bool IgnoreTransferIfNoTracker => Gen8TransferTrackerNotPresent == Severity.Invalid;
public static void InitFromSettings(IParseSettings settings)
{
CheckWordFilter = settings.CheckWordFilter;