From b1f31e8198f090e056c99e0bc6aab402ca24cd08 Mon Sep 17 00:00:00 2001 From: Kurt Date: Thu, 22 Dec 2022 12:12:13 -0800 Subject: [PATCH] Update EntityPID.cs --- PKHeX.Core/PKM/Util/EntityPID.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/PKHeX.Core/PKM/Util/EntityPID.cs b/PKHeX.Core/PKM/Util/EntityPID.cs index 505c77b0fe0..47afa253c28 100644 --- a/PKHeX.Core/PKM/Util/EntityPID.cs +++ b/PKHeX.Core/PKM/Util/EntityPID.cs @@ -19,12 +19,12 @@ public static class EntityPID public static uint GetRandomPID(Random rnd, ushort species, int gender, int origin, int nature, byte form, uint oldPID) { // Gen6+ (and VC) PIDs do not tie PID to Nature/Gender/Ability - if (origin >= 24) + if (origin is 0 or >= 24) return rnd.Rand32(); // Below logic handles Gen3-5. // No need to get form specific entry, as Gen3-5 do not have that feature. - int gt = PKX.Personal[species].Gender; + var gt = PersonalTable.B2W2[species].Gender; bool g34 = origin <= 15; uint abilBitVal = g34 ? oldPID & 0x0000_0001 : oldPID & 0x0001_0000;