diff --git a/PKHeX.Core/Legality/Checks.cs b/PKHeX.Core/Legality/Checks.cs index f729df92f..1394d7a14 100644 --- a/PKHeX.Core/Legality/Checks.cs +++ b/PKHeX.Core/Legality/Checks.cs @@ -9,10 +9,11 @@ namespace PKHeX.Core { private void VerifyGender() { - if (pkm.PersonalInfo.Gender == 255 && pkm.Gender != 2) + var gr = pkm.PersonalInfo.Gender; + if (gr == 255 && pkm.Gender != 2) { // DP/HGSS shedinja glitch -- only generation 4 spawns - bool ignore = pkm.Species == 292 && pkm.Format == 4 && pkm.Met_Level != pkm.CurrentLevel; + bool ignore = pkm.Format == 4 && pkm.Species == 292 && pkm.Met_Level != pkm.CurrentLevel; if (!ignore) AddLine(Severity.Invalid, V203, CheckIdentifier.Gender); } @@ -22,7 +23,12 @@ namespace PKHeX.Core bool PIDGender = 3 <= gen && gen <= 5; if (!PIDGender) + { + // Check fixed gender cases + if ((gr == 254 || gr == 0) && (gr == 0 ? 0 : 1) != pkm.Gender) + AddLine(Severity.Invalid, V203, CheckIdentifier.Gender); return; + } bool genderValid = pkm.IsGenderValid(); if (!genderValid) @@ -41,7 +47,7 @@ namespace PKHeX.Core genderValid = true; } } - else if (3 <= Info.Generation && Info.Generation <= 5) + else { // check for mixed->fixed gender incompatibility by checking the gender of the original species if (Legal.FixedGenderFromBiGender.Contains(EncounterMatch.Species) && pkm.Gender != 2) // shedinja diff --git a/PKHeX.Core/PKM/PKM.cs b/PKHeX.Core/PKM/PKM.cs index 1eec8b014..5ff78885b 100644 --- a/PKHeX.Core/PKM/PKM.cs +++ b/PKHeX.Core/PKM/PKM.cs @@ -652,7 +652,8 @@ namespace PKHeX.Core if (gv == 0) return gender == 0; - if (GenNumber >= 6) + int gen = GenNumber; + if (2 <= gen || gen >= 6) return true; return gender == PKX.GetGenderFromPIDAndRatio(PID, gv); diff --git a/PKHeX.WinForms/Controls/PKM Editor/PKMEditor.cs b/PKHeX.WinForms/Controls/PKM Editor/PKMEditor.cs index 74064cb41..f257e69e1 100644 --- a/PKHeX.WinForms/Controls/PKM Editor/PKMEditor.cs +++ b/PKHeX.WinForms/Controls/PKM Editor/PKMEditor.cs @@ -513,9 +513,6 @@ namespace PKHeX.WinForms.Controls if (gt == 255 || gt == 0 || gt == 254) // Single gender/genderless return; - if (gt >= 255) return; - // If not a single gender(less) species: (should be <254 but whatever, 255 never happens) - int newGender = PKX.GetGenderFromString(Label_Gender.Text) ^ 1; if (pkm.Format <= 2) {