Fix dex gender set again

Closes #2356
update test case to actually set a genderless gender
This commit is contained in:
Kurt 2019-07-12 23:43:12 -07:00
parent f37a587a1c
commit 82f305cd36
2 changed files with 4 additions and 2 deletions

View file

@ -118,7 +118,7 @@ namespace PKHeX.Core
protected void SetDexFlags(int baseBit, int formBit, int gender, int shiny, bool value = true) protected void SetDexFlags(int baseBit, int formBit, int gender, int shiny, bool value = true)
{ {
int shift = gender | (shiny << 1); int shift = (gender & 1) | (shiny << 1);
// Set the [Species/Gender/Shiny] Seen Flag // Set the [Species/Gender/Shiny] Seen Flag
SetFlag(OFS_SEEN + (shift * BitSeenSize), baseBit, value); SetFlag(OFS_SEEN + (shift * BitSeenSize), baseBit, value);

View file

@ -1,7 +1,8 @@
using Xunit; using Xunit;
using FluentAssertions; using FluentAssertions;
using PKHeX.Core;
namespace PKHeX.Core.Tests.Saves namespace PKHeX.Tests.Saves
{ {
public static class PokeDex public static class PokeDex
{ {
@ -27,6 +28,7 @@ namespace PKHeX.Core.Tests.Saves
private static void SetDexSpecies(SaveFile sav, int species, int regionSize) private static void SetDexSpecies(SaveFile sav, int species, int regionSize)
{ {
var pk5 = new PK5 {Species = species, TID = 1337}; // non-shiny var pk5 = new PK5 {Species = species, TID = 1337}; // non-shiny
pk5.Gender = pk5.GetSaneGender();
int boxofs = sav.GetBoxSlotOffset(0, 0); int boxofs = sav.GetBoxSlotOffset(0, 0);
sav.SetStoredSlot(pk5, boxofs); sav.SetStoredSlot(pk5, boxofs);