Changed sFixedIVTable access from hardcoded index limits to ARRAY_COUNT
This commit is contained in:
@@ -745,11 +745,11 @@ u8 GetFactoryMonFixedIV(u8 challengeNum, bool8 isLastBattle)
|
|||||||
// or the "elevated" rentals from round 8 (challengeNum+1==8)
|
// or the "elevated" rentals from round 8 (challengeNum+1==8)
|
||||||
// This happens to land on a number higher than 31, which is interpreted as "random IVs"
|
// This happens to land on a number higher than 31, which is interpreted as "random IVs"
|
||||||
#ifdef BUGFIX
|
#ifdef BUGFIX
|
||||||
if (challengeNum > 7)
|
if (challengeNum >= ARRAY_COUNT(sFixedIVTable))
|
||||||
#else
|
#else
|
||||||
if (challengeNum > 8)
|
if (challengeNum > ARRAY_COUNT(sFixedIVTable))
|
||||||
#endif
|
#endif
|
||||||
ivSet = 7;
|
ivSet = ARRAY_COUNT(sFixedIVTable) - 1;
|
||||||
else
|
else
|
||||||
ivSet = challengeNum;
|
ivSet = challengeNum;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user