From 188371ce1ff6e046fd98081c8d08ddea434fbd89 Mon Sep 17 00:00:00 2001 From: Lincoln-LM <73306575+Lincoln-LM@users.noreply.github.com> Date: Wed, 26 Oct 2022 23:00:03 -0600 Subject: [PATCH] Fix BDSP Unown form rand call location (#278) Fixes Admiral-Fish#248 --- Source/Core/Gen8/Generators/WildGenerator8.cpp | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/Source/Core/Gen8/Generators/WildGenerator8.cpp b/Source/Core/Gen8/Generators/WildGenerator8.cpp index 18691a891..2ac0dc0f3 100644 --- a/Source/Core/Gen8/Generators/WildGenerator8.cpp +++ b/Source/Core/Gen8/Generators/WildGenerator8.cpp @@ -43,6 +43,10 @@ std::vector WildGenerator8::generate(u64 seed0, u64 seed1, const Enco WildState state(initialAdvances + cnt); Xorshift gen(rng); u8 slotPercent = gen.next<0, 100>(); + if (encounterArea.getLocation() > 222 && encounterArea.getLocation() < 244) + { // Unown form call + gen.next(); // gen.next<0,1>() for F/R/I/E/N/D, gen.next<0,2>() for !/?, gen.next<0,20>() otherwise + } gen.advance(84); switch (encounter) { @@ -112,11 +116,6 @@ std::vector WildGenerator8::generate(u64 seed0, u64 seed1, const Enco state.setAbility(gen.next() % 2); - if (encounterArea.getLocation() > 222 && encounterArea.getLocation() < 244) - { // TODO: add unown check - u32 unownForm = gen.next() % 28; // Form call - } - if (genderRatio == 255) { state.setGender(2);