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
This commit is contained in:
Kurt 2020-09-29 23:10:48 -07:00
parent cc3a807fa9
commit eb6c570695

View file

@ -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)