From 19a897923d9c04864b7473116a1902f7f3bcc97a Mon Sep 17 00:00:00 2001 From: Kurt Date: Wed, 1 Aug 2018 20:39:20 -0700 Subject: [PATCH] Reference original encounter for sensitive checks https://projectpokemon.org/home/forums/topic/46143-bug-in-last-update/?do=findComment&comment=234360 thanks paf! --- PKHeX.Core/Legality/Verifiers/LevelVerifier.cs | 4 ++-- PKHeX.Core/Legality/Verifiers/MiscVerifier.cs | 2 +- PKHeX.Core/Legality/Verifiers/NicknameVerifier.cs | 6 +++--- .../230 - Kingdra - DFF1FEBB3C31.pk7 | Bin 0 -> 232 bytes 4 files changed, 6 insertions(+), 6 deletions(-) create mode 100644 Tests/PKHeX.Tests/Legality/Legal/Generation 7 Transfer/230 - Kingdra - DFF1FEBB3C31.pk7 diff --git a/PKHeX.Core/Legality/Verifiers/LevelVerifier.cs b/PKHeX.Core/Legality/Verifiers/LevelVerifier.cs index c7de5105c..c8d2c020b 100644 --- a/PKHeX.Core/Legality/Verifiers/LevelVerifier.cs +++ b/PKHeX.Core/Legality/Verifiers/LevelVerifier.cs @@ -12,7 +12,7 @@ namespace PKHeX.Core public override void Verify(LegalityAnalysis data) { var pkm = data.pkm; - var EncounterMatch = data.EncounterMatch; + var EncounterMatch = data.EncounterOriginal; if (EncounterMatch is MysteryGift gift) { if (gift.Level != pkm.Met_Level && pkm.HasOriginalMetLocation) @@ -64,7 +64,7 @@ namespace PKHeX.Core public void VerifyG1(LegalityAnalysis data) { var pkm = data.pkm; - var EncounterMatch = data.EncounterMatch; + var EncounterMatch = data.EncounterOriginal; if (pkm.IsEgg) { int elvl = Legal.GetEggHatchLevel(pkm); diff --git a/PKHeX.Core/Legality/Verifiers/MiscVerifier.cs b/PKHeX.Core/Legality/Verifiers/MiscVerifier.cs index ed88f69b1..1f035c4e5 100644 --- a/PKHeX.Core/Legality/Verifiers/MiscVerifier.cs +++ b/PKHeX.Core/Legality/Verifiers/MiscVerifier.cs @@ -181,7 +181,7 @@ namespace PKHeX.Core if (pkm.Move1_PP != pkm.GetMovePP(pkm.Move1, 0) || pkm.Move2_PP != pkm.GetMovePP(pkm.Move2, 0) || pkm.Move3_PP != pkm.GetMovePP(pkm.Move3, 0) || pkm.Move4_PP != pkm.GetMovePP(pkm.Move4, 0)) data.AddLine(GetInvalid(V420, CheckIdentifier.Egg)); - var EncounterMatch = data.EncounterMatch; + var EncounterMatch = data.EncounterOriginal; var HatchCycles = (EncounterMatch as EncounterStatic)?.EggCycles; if (HatchCycles == 0 || HatchCycles == null) HatchCycles = pkm.PersonalInfo.HatchCycles; diff --git a/PKHeX.Core/Legality/Verifiers/NicknameVerifier.cs b/PKHeX.Core/Legality/Verifiers/NicknameVerifier.cs index 705e6c829..68bb06b9a 100644 --- a/PKHeX.Core/Legality/Verifiers/NicknameVerifier.cs +++ b/PKHeX.Core/Legality/Verifiers/NicknameVerifier.cs @@ -13,7 +13,7 @@ namespace PKHeX.Core public override void Verify(LegalityAnalysis data) { var pkm = data.pkm; - var EncounterMatch = data.EncounterMatch; + var EncounterMatch = data.EncounterOriginal; // If the Pokémon is not nicknamed, it should match one of the language strings. if (pkm.Nickname.Length == 0) @@ -84,7 +84,7 @@ namespace PKHeX.Core } else { - var EncounterMatch = data.EncounterMatch; + var EncounterMatch = data.EncounterOriginal; // Can't have another language name if it hasn't evolved or wasn't a language-traded egg. bool evolved = EncounterMatch.Species != pkm.Species; bool match = PKX.GetSpeciesNameGeneration(pkm.Species, pkm.Language, pkm.Format) == nickname; @@ -394,7 +394,7 @@ namespace PKHeX.Core string OT = validOT[(validOT.Length / 2) + index]; var pkm = data.pkm; - var EncounterMatch = data.EncounterMatch; + var EncounterMatch = data.EncounterOriginal; if (!IsNicknameMatch(nick, pkm, EncounterMatch)) // trades that are not nicknamed (but are present in a table with others being named) data.AddLine(GetInvalid(V9, CheckIdentifier.Nickname)); else diff --git a/Tests/PKHeX.Tests/Legality/Legal/Generation 7 Transfer/230 - Kingdra - DFF1FEBB3C31.pk7 b/Tests/PKHeX.Tests/Legality/Legal/Generation 7 Transfer/230 - Kingdra - DFF1FEBB3C31.pk7 new file mode 100644 index 0000000000000000000000000000000000000000..3307a1d6d1e4a75562cc6ab0859e8e1004f0150d GIT binary patch literal 232 zcmXrC+5L}!;p6>h3=9l>dl(qn^%)r0SQr@gIInKx0*Vm=-VB)xc?{_cDGWsni9p35 zHUwBgX?`e;p#J~=Zy&(m&EUb1$`FANhOrnKIABZ=?Z&{!!U-2}V(?*bWC(@x5sW%G WQ;>%b$hIwI5ob^_6k%iqNdN$1IuyGA literal 0 HcmV?d00001