diff --git a/PKHeX.Core/Legality/RNG/ClassicEra/Gen4/GenerateMethodJ.cs b/PKHeX.Core/Legality/RNG/ClassicEra/Gen4/GenerateMethodJ.cs index 0ab0c9923..074a83143 100644 --- a/PKHeX.Core/Legality/RNG/ClassicEra/Gen4/GenerateMethodJ.cs +++ b/PKHeX.Core/Legality/RNG/ClassicEra/Gen4/GenerateMethodJ.cs @@ -37,11 +37,11 @@ public static class GenerateMethodJ continue; } } - var esv = LCRNG.Next16(ref seed) / 656; + var esv = LCRNG.Next16(ref seed) / 656u; if (esv < min || esv > max) continue; var lv = randLevel ? LCRNG.Next16(ref seed) : 0; - var nature = LCRNG.Next16(ref seed) % 25; + var nature = MethodJ.GetNature(LCRNG.Next16(ref seed)); if (criteria.IsSpecifiedNature() && nature != (byte)criteria.Nature) continue; diff --git a/PKHeX.Core/Legality/RNG/ClassicEra/Gen4/GenerateMethodK.cs b/PKHeX.Core/Legality/RNG/ClassicEra/Gen4/GenerateMethodK.cs index b25846318..584ead0a5 100644 --- a/PKHeX.Core/Legality/RNG/ClassicEra/Gen4/GenerateMethodK.cs +++ b/PKHeX.Core/Legality/RNG/ClassicEra/Gen4/GenerateMethodK.cs @@ -23,7 +23,7 @@ public static class GenerateMethodK var ability = criteria.GetAbilityFromNumber(AbilityPermission.Any12); var (min, max) = SlotMethodK.GetRange(enc.Type, enc.SlotNumber); bool randLevel = MethodK.IsLevelRand(enc); - var modulo = enc.Type.IsSafari() ? 10 : 100; + var modulo = enc.Type.IsSafari() ? 10u : 100u; bool checkProc = MethodK.IsEncounterCheckApplicable(enc.Type); // Generate Method K correlated PID and IVs, no lead (keep things simple). @@ -42,7 +42,7 @@ public static class GenerateMethodK if (esv < min || esv > max) continue; var lv = randLevel ? LCRNG.Next16(ref seed) : 0; - var nature = LCRNG.Next16(ref seed) % 25; + var nature = MethodK.GetNature(LCRNG.Next16(ref seed)); if (criteria.IsSpecifiedNature() && nature != (byte)criteria.Nature) continue; diff --git a/PKHeX.Core/Legality/RNG/ClassicEra/Gen4/MethodJ.cs b/PKHeX.Core/Legality/RNG/ClassicEra/Gen4/MethodJ.cs index a66384bb4..1a46510b5 100644 --- a/PKHeX.Core/Legality/RNG/ClassicEra/Gen4/MethodJ.cs +++ b/PKHeX.Core/Legality/RNG/ClassicEra/Gen4/MethodJ.cs @@ -64,7 +64,7 @@ public static class MethodJ private static bool IsFeebasChance(uint rand) => (rand >> 15) == 1; - private static uint GetNature(uint rand) => rand / 0xA3Eu; + public static uint GetNature(uint rand) => rand / 0xA3Eu; public static uint GetHoneyTreeLevel(uint rand) => 5 + (rand / 0x1745); // 5957; rand(11) using the pre-compiled rand function. /// diff --git a/PKHeX.Core/Legality/RNG/ClassicEra/Gen4/MethodK.cs b/PKHeX.Core/Legality/RNG/ClassicEra/Gen4/MethodK.cs index 8367e21f1..50542b3e2 100644 --- a/PKHeX.Core/Legality/RNG/ClassicEra/Gen4/MethodK.cs +++ b/PKHeX.Core/Legality/RNG/ClassicEra/Gen4/MethodK.cs @@ -65,7 +65,7 @@ public static class MethodK //private static bool IsIntimidateKeenEyeFail(uint rand) => (rand & 1) != 1; private static bool IsIntimidateKeenEyePass(uint rand) => (rand & 1) == 1; - private static uint GetNature(uint rand) => rand % 25; + public static uint GetNature(uint rand) => rand % 25; /// /// Gets the first possible origin seed and lead for the input encounter & constraints.