diff options
Diffstat (limited to 'src/contest_ai.c')
-rw-r--r-- | src/contest_ai.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/src/contest_ai.c b/src/contest_ai.c index 2f048718f..8fe339790 100644 --- a/src/contest_ai.c +++ b/src/contest_ai.c @@ -1734,8 +1734,9 @@ static void ContestAICmd_if_user_doesnt_have_exciting_move(void) // they're checking for an effect. Checking for a specific effect would make more sense, // but given that effects are normally read as a single byte and this reads 2 bytes, it // seems reading a move was intended and the AI script is using it incorrectly. -// In any case, to fix it to correctly check for effects replace the u16 move assignment with -// u16 move = gContestMoves[gContestMons[eContestAI.contestantId].moves[i]].effect; +// The fix below aligns the function with how it's used by the script, rather than the apparent +// intention of its usage + static void ContestAICmd_check_user_has_move(void) { int hasMove = FALSE; @@ -1744,7 +1745,12 @@ static void ContestAICmd_check_user_has_move(void) for (i = 0; i < MAX_MON_MOVES; i++) { + #ifdef BUGFIX + u16 move = gContestMoves[gContestMons[eContestAI.contestantId].moves[i]].effect; + #else u16 move = gContestMons[eContestAI.contestantId].moves[i]; + #endif + if (move == targetMove) { hasMove = TRUE; |