Restore bugfix
Ooopsie!
This commit is contained in:
parent
267cf1e6f0
commit
68ee9e5739
1 changed files with 12 additions and 0 deletions
|
@ -558,8 +558,20 @@ static void InheritIVs(struct Pokemon *egg, struct DayCare *daycare, struct BoxP
|
||||||
// Select which IVs that will be inherited.
|
// Select which IVs that will be inherited.
|
||||||
for (i = 0; i < howManyIVs; i++)
|
for (i = 0; i < howManyIVs; i++)
|
||||||
{
|
{
|
||||||
|
// Randomly pick an IV from the available list and stop from being chosen again.
|
||||||
|
// BUG: Instead of removing the IV that was just picked, this
|
||||||
|
// removes position 0 (HP) then position 1 (DEF), then position 2. This is why HP and DEF
|
||||||
|
// have a lower chance to be inherited in Emerald and why the IV picked for inheritance can
|
||||||
|
// be repeated. Amusingly, FRLG and RS also got this wrong. They remove selectedIvs[i], which
|
||||||
|
// is not an index! This means that it can sometimes remove the wrong stat.
|
||||||
|
#ifndef BUGFIX
|
||||||
selectedIvs[i] = availableIVs[Random() % (NUM_STATS - i)];
|
selectedIvs[i] = availableIVs[Random() % (NUM_STATS - i)];
|
||||||
RemoveIVIndexFromList(availableIVs, i);
|
RemoveIVIndexFromList(availableIVs, i);
|
||||||
|
#else
|
||||||
|
u8 index = Random() % (NUM_STATS - i);
|
||||||
|
selectedIvs[i] = availableIVs[index];
|
||||||
|
RemoveIVIndexFromList(availableIVs, index);
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
// Determine which parent each of the selected IVs should inherit from.
|
// Determine which parent each of the selected IVs should inherit from.
|
||||||
|
|
Loading…
Reference in a new issue