Add MOD to match mod with powers of 2

This commit is contained in:
GriffinR
2023-08-16 16:44:45 -04:00
parent 057928438a
commit bdc0ea1037
8 changed files with 21 additions and 14 deletions

View File

@@ -326,7 +326,7 @@ u8 ContestAI_GetActionToUse(void)
{
// Randomly choose a move index. If it's the move
// with the highest (or tied highest) score, return
u8 moveIdx = Random() & (MAX_MON_MOVES - 1); // % MAX_MON_MOVES doesn't match
u8 moveIdx = MOD(Random(), MAX_MON_MOVES);
u8 score = eContestAI.moveScores[moveIdx];
int i;
for (i = 0; i < MAX_MON_MOVES; i++)