From c8747d4ede2c0b203bda7ecf47672a8d86c9807c Mon Sep 17 00:00:00 2001 From: Kurt Date: Thu, 27 Jun 2019 21:38:24 -0700 Subject: [PATCH] Apply OT mismatch deferral to gen2 Check the OT length for the deferral other encounters are more permissive than trades, hence why we defer unless we know for certain. Same OTs are possible, except for the too-long ones! Closes #2338 , thanks @WEERSOQUEER ! --- .../Encounters/Generator/EncounterGenerator.cs | 3 ++- .../213 - MODRI - 258CF51FC5F2.pk7 | Bin 0 -> 232 bytes 2 files changed, 2 insertions(+), 1 deletion(-) create mode 100644 Tests/PKHeX.Core.Tests/Legality/Legal/Generation 7 Transfer/213 - MODRI - 258CF51FC5F2.pk7 diff --git a/PKHeX.Core/Legality/Encounters/Generator/EncounterGenerator.cs b/PKHeX.Core/Legality/Encounters/Generator/EncounterGenerator.cs index 3202d87b6..701dbd83e 100644 --- a/PKHeX.Core/Legality/Encounters/Generator/EncounterGenerator.cs +++ b/PKHeX.Core/Legality/Encounters/Generator/EncounterGenerator.cs @@ -147,7 +147,8 @@ private static IEnumerable GenerateRawEncounters12(PKM pkm, Game var deferred = new List(); foreach (var t in GetValidEncounterTrades(pkm, vs, game)) { - if (pkm.Format >= 7 && (t.Generation == 2 || t.GetOT(pkm.Language) != pkm.OT_Name)) // ot length collision + // some OTs are longer than the keyboard entry; don't defer these + if (pkm.Format >= 7 && pkm.OT_Name.Length <= (pkm.Japanese || pkm.Korean ? 5 : 7)) { deferred.Add(t); continue; diff --git a/Tests/PKHeX.Core.Tests/Legality/Legal/Generation 7 Transfer/213 - MODRI - 258CF51FC5F2.pk7 b/Tests/PKHeX.Core.Tests/Legality/Legal/Generation 7 Transfer/213 - MODRI - 258CF51FC5F2.pk7 new file mode 100644 index 0000000000000000000000000000000000000000..1b56852d184249a03777996a2fb7500c72160d0a GIT binary patch literal 232 zcmex#RQ@XiLyziJ1_lN;CI*Jj>