mirror of
https://github.com/kwsch/PKHeX
synced 2024-11-23 12:33:06 +00:00
Fix gender handling
Closes #1933 if not allowed to be genderless, flag as invalid gender only permit valid genders after genderless is ruled out (both done by checking the low bit)
This commit is contained in:
parent
9fb7056837
commit
815705bc5e
2 changed files with 2 additions and 2 deletions
|
@ -654,7 +654,7 @@ namespace PKHeX.Core
|
|||
|
||||
int gen = GenNumber;
|
||||
if (2 >= gen || gen >= 6)
|
||||
return true;
|
||||
return gender == (gender & 1);
|
||||
|
||||
return gender == PKX.GetGenderFromPIDAndRatio(PID, gv);
|
||||
}
|
||||
|
|
|
@ -509,7 +509,7 @@ namespace PKHeX.WinForms.Controls
|
|||
if (gt == 255 || gt == 0 || gt == 254) // Single gender/genderless
|
||||
return;
|
||||
|
||||
int newGender = PKX.GetGenderFromString(Label_Gender.Text) ^ 1;
|
||||
int newGender = (PKX.GetGenderFromString(Label_Gender.Text) & 1) ^ 1;
|
||||
if (pkm.Format <= 2)
|
||||
{
|
||||
Stats.SetATKIVGender(newGender);
|
||||
|
|
Loading…
Reference in a new issue