diff --git a/PKHeX.Core/MysteryGifts/PGT.cs b/PKHeX.Core/MysteryGifts/PGT.cs index 8f840e61a..b50fd544a 100644 --- a/PKHeX.Core/MysteryGifts/PGT.cs +++ b/PKHeX.Core/MysteryGifts/PGT.cs @@ -271,20 +271,15 @@ public override PKM ConvertToPKM(ITrainerInfo SAV) uint seed = Util.Rand32(); if (pk4.PID == 1) // Create Nonshiny { - uint pid1 = PKX.LCRNG(ref seed) >> 16; - uint pid2 = PKX.LCRNG(ref seed) >> 16; + do { + uint pid1 = PKX.LCRNG(ref seed) >> 16; + uint pid2 = PKX.LCRNG(ref seed) >> 16; + pk4.PID = pid1 | (pid2 << 16); + // sanity check gender for non-genderless PID cases + } while (!pk4.IsGenderValid()); - while ((pid1 ^ pid2 ^ pk4.TID ^ pk4.SID) < 8) - { - uint testPID = pid1 | pid2 << 16; - - // Call the ARNG to change the PID - testPID = RNG.ARNG.Next(testPID); - - pid1 = testPID & 0xFFFF; - pid2 = testPID >> 16; - } - pk4.PID = pid1 | (pid2 << 16); + while (pk4.IsShiny) // Call the ARNG to change the PID + pk4.PID = RNG.ARNG.Next(pk4.PID); } if (!IsManaphyEgg) seed = Util.Rand32(); // reseed, do not have method 1 correlation diff --git a/PKHeX.Core/MysteryGifts/WC3.cs b/PKHeX.Core/MysteryGifts/WC3.cs index de13d334c..4b6934104 100644 --- a/PKHeX.Core/MysteryGifts/WC3.cs +++ b/PKHeX.Core/MysteryGifts/WC3.cs @@ -103,7 +103,9 @@ public override PKM ConvertToPKM(ITrainerInfo SAV) pk.TID = SAV.TID; pk.SID = SAV.SID; pk.OT_Friendship = pi.BaseFriendship; - pk.Met_Location = 32; + pk.Met_Location = pk.FRLG ? 146 /* Four Island */ : 32; // Route 117 + pk.FatefulEncounter &= pk.FRLG; // clear flag for RSE + pk.Met_Level = 0; // hatched } else {