Changed sFixedIVTable access from hardcoded index limits to ARRAY_COUNT

This commit is contained in:
kaboissonneault 2023-10-05 08:26:34 -04:00
parent 3a8a82d385
commit 0a183c2027

View file

@ -745,11 +745,11 @@ u8 GetFactoryMonFixedIV(u8 challengeNum, bool8 isLastBattle)
// 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"
#ifdef BUGFIX
if (challengeNum > 7)
if (challengeNum >= ARRAY_COUNT(sFixedIVTable))
#else
if (challengeNum > 8)
if (challengeNum > ARRAY_COUNT(sFixedIVTable))
#endif
ivSet = 7;
ivSet = ARRAY_COUNT(sFixedIVTable) - 1;
else
ivSet = challengeNum;