From eb6c570695d7b44fdc6c9d93f0cd40ed0baa60a7 Mon Sep 17 00:00:00 2001 From: Kurt Date: Tue, 29 Sep 2020 23:10:48 -0700 Subject: [PATCH] Add TSV=0 checks for WC8 home gifts Don't match if TSV == 0 Don't assign at TSV of 0, randomize TID7 if it happens to be so. Closes #3007 --- PKHeX.Core/MysteryGifts/WC8.cs | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/PKHeX.Core/MysteryGifts/WC8.cs b/PKHeX.Core/MysteryGifts/WC8.cs index afa55a2f2..309b844c3 100644 --- a/PKHeX.Core/MysteryGifts/WC8.cs +++ b/PKHeX.Core/MysteryGifts/WC8.cs @@ -389,7 +389,13 @@ namespace PKHeX.Core pk.SID = sav.SID; if (IsHOMEGift) + { pk.TrainerSID7 = 0; + while (pk.TSV == 0) + { + pk.TrainerID7 = Util.Rand.Next(16, 999_999); + } + } } // Official code explicitly corrects for Meowstic @@ -535,6 +541,9 @@ namespace PKHeX.Core if (EncryptionConstant != pkm.EncryptionConstant) return false; + if (pkm.TSV == 0) // HOME doesn't assign TSV=0 to accounts. + return false; + if (IsShiny) { if (!pkm.IsShiny)