mirror of
https://github.com/kwsch/PKHeX
synced 2025-02-17 05:48:44 +00:00
Fix roamer PIDIV method detection
http://bulbapedia.bulbagarden.net/wiki/List_of_glitches_in_Generation_III#Roaming_Pok.C3.A9mon_IV_bug only 8 bits are transferred, not the top 2 IVs (10bits). Add appropriate constraints
This commit is contained in:
parent
4201e10a0e
commit
a959e31063
1 changed files with 3 additions and 4 deletions
|
@ -161,8 +161,7 @@ namespace PKHeX.Core
|
|||
}
|
||||
private static bool getLCRNGRoamerMatch(uint top, uint bot, uint[] IVs, out PIDIV pidiv)
|
||||
{
|
||||
var iv2 = getIVChunk(IVs, 3);
|
||||
if (iv2 != 0 || IVs[2] != 0)
|
||||
if (IVs.Skip(2).Any(iv => iv != 0) || IVs[1] > 7)
|
||||
{
|
||||
pidiv = null;
|
||||
return false;
|
||||
|
@ -171,8 +170,8 @@ namespace PKHeX.Core
|
|||
var reg = getSeedsFromPID(RNG.LCRNG, top, bot);
|
||||
foreach (var seed in reg)
|
||||
{
|
||||
// Only the first two IVs are kept
|
||||
var ivC = RNG.LCRNG.Advance(seed, 3) >> 16 & 0x03FF;
|
||||
// Only the first 8 bits are kept
|
||||
var ivC = RNG.LCRNG.Advance(seed, 3) >> 16 & 0x00FF;
|
||||
if (iv1 != ivC)
|
||||
continue;
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue