Skip to content

Commit

Permalink
Tweak everstone logic
Browse files Browse the repository at this point in the history
Fixes #270
  • Loading branch information
Admiral-Fish committed Sep 15, 2022
1 parent 8cc4f37 commit 6f086de
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions Source/Core/Gen3/Generators/EggGenerator3.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -193,26 +193,25 @@ std::vector<EggState3> EggGenerator3::generateEmeraldPID() const
std::vector<EggState3> states;

// Determine if female parent is holding everstone
bool everstone = false;
u8 parent;
for (u8 i = 0; i < 2; i++)
{
if (daycare.getParentGender(i) == 1 && daycare.getParentItem(i) == 1)
if (daycare.getParentGender(i) == 1)
{
parent = i;
everstone = true;
}
}

for (u8 i = 0; i < 2; i++)
{
if (daycare.getParentGender(i) == 3 && daycare.getParentItem(i) == 1)
if (daycare.getParentGender(i) == 3)
{
parent = i;
everstone = true;
}
}

bool everstone = daycare.getParentItem(parent) == 1;

PokeRNG rng(0);
rng.advance(initialAdvances);

Expand All @@ -233,7 +232,7 @@ std::vector<EggState3> EggGenerator3::generateEmeraldPID() const

PokeRNG trng((val - offset) & 0xFFFF);

u32 pid = 0;
u32 pid;
if (!flag)
{
pid = ((go.nextUShort() % 0xFFFE) + 1) | (trng.next() & 0xFFFF0000);
Expand Down

0 comments on commit 6f086de

Please sign in to comment.