diff --git a/PKHeX.Core/PKM/PKM.cs b/PKHeX.Core/PKM/PKM.cs index 81a683eea..e782b04b7 100644 --- a/PKHeX.Core/PKM/PKM.cs +++ b/PKHeX.Core/PKM/PKM.cs @@ -585,7 +585,7 @@ public virtual bool getGenderIsValid() if (GenNumber >= 6) return true; - return gender == PKX.getGender(Species, PID, gv); + return gender == PKX.getGender(PID, gv); } /// diff --git a/PKHeX.Core/PKM/PKX.cs b/PKHeX.Core/PKM/PKX.cs index 8a23cc622..06cd4e469 100644 --- a/PKHeX.Core/PKM/PKX.cs +++ b/PKHeX.Core/PKM/PKX.cs @@ -474,7 +474,7 @@ public static uint getRandomPID(int species, int cg, int origin, int nature, int return pid; // PID can be anything // Gen 3/4/5: Gender derived from PID - if (cg == getGender(species, pid, gt)) + if (cg == getGender(pid, gt)) return pid; } } @@ -1408,17 +1408,16 @@ public static int getG3Species(int g4index) public static int getGender(int species, uint PID) { int genderratio = Personal[species].Gender; - return getGender(species, PID, genderratio); + return getGender(PID, genderratio); } - public static int getGender(int species, uint PID, int gv) + public static int getGender(uint PID, int gr) { - int genderratio = Personal[species].Gender; - switch (genderratio) + switch (gr) { case 255: return 2; case 254: return 1; case 0: return 0; - default: return (PID & 0xFF) <= genderratio ? 1 : 0; + default: return (PID & 0xFF) < gr ? 1 : 0; } } #region Gen 3 Species Table