mirror of
https://github.com/kwsch/PKHeX
synced 2024-11-22 12:03:10 +00:00
Handle BDSP eggs not having any trash
This commit is contained in:
parent
de6c1baaf2
commit
114ba4c991
1 changed files with 16 additions and 3 deletions
|
@ -86,9 +86,17 @@ public sealed class TrashByteVerifier : Verifier
|
|||
VerifyTrashNotEmpty(data, pk.HandlingTrainerTrash, HandlingTrainer);
|
||||
VerifyTrashNone(data, pk.OriginalTrainerTrash, OriginalTrainer);
|
||||
|
||||
// Species name is overwritten by "Egg"
|
||||
var origName = SpeciesName.GetSpeciesName(pk.Species, pk.Language);
|
||||
VerifyTrashSpecific(data, pk.NicknameTrash, origName, Nickname);
|
||||
if (IsTrashCleanContext(pk.Context))
|
||||
{
|
||||
VerifyTrashNone(data, pk.NicknameTrash, Nickname);
|
||||
VerifyTrashNone(data, pk.HandlingTrainerTrash, HandlingTrainer);
|
||||
}
|
||||
else
|
||||
{
|
||||
// Species name is overwritten by "Egg"
|
||||
var origName = SpeciesName.GetSpeciesName(pk.Species, pk.Language);
|
||||
VerifyTrashSpecific(data, pk.NicknameTrash, origName, Nickname);
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -112,6 +120,11 @@ public sealed class TrashByteVerifier : Verifier
|
|||
}
|
||||
}
|
||||
|
||||
private static bool IsTrashCleanContext(EntityContext context)
|
||||
{
|
||||
return context is EntityContext.Gen8b;
|
||||
}
|
||||
|
||||
private void VerifyTrashNickname(LegalityAnalysis data, ReadOnlySpan<byte> span)
|
||||
{
|
||||
var pk = data.Entity;
|
||||
|
|
Loading…
Reference in a new issue