mirror of
https://github.com/kwsch/PKHeX
synced 2024-11-25 13:30:20 +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);
|
VerifyTrashNotEmpty(data, pk.HandlingTrainerTrash, HandlingTrainer);
|
||||||
VerifyTrashNone(data, pk.OriginalTrainerTrash, OriginalTrainer);
|
VerifyTrashNone(data, pk.OriginalTrainerTrash, OriginalTrainer);
|
||||||
|
|
||||||
// Species name is overwritten by "Egg"
|
if (IsTrashCleanContext(pk.Context))
|
||||||
var origName = SpeciesName.GetSpeciesName(pk.Species, pk.Language);
|
{
|
||||||
VerifyTrashSpecific(data, pk.NicknameTrash, origName, Nickname);
|
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;
|
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)
|
private void VerifyTrashNickname(LegalityAnalysis data, ReadOnlySpan<byte> span)
|
||||||
{
|
{
|
||||||
var pk = data.Entity;
|
var pk = data.Entity;
|
||||||
|
|
Loading…
Reference in a new issue