mirror of
https://github.com/Ninjdai1/pokeemerald.git
synced 2024-12-26 19:54:21 +01:00
Restore bugfix
Ooopsie!
This commit is contained in:
parent
267cf1e6f0
commit
68ee9e5739
@ -558,8 +558,20 @@ static void InheritIVs(struct Pokemon *egg, struct DayCare *daycare, struct BoxP
|
||||
// Select which IVs that will be inherited.
|
||||
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)];
|
||||
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.
|
||||
|
Loading…
Reference in New Issue
Block a user