diff options
author | luckytyphlosion <10688458+luckytyphlosion@users.noreply.github.com> | 2020-12-16 14:51:21 -0500 |
---|---|---|
committer | luckytyphlosion <10688458+luckytyphlosion@users.noreply.github.com> | 2020-12-16 14:51:21 -0500 |
commit | 34fc9789c9d11464161aabf022eb270597c6778a (patch) | |
tree | d7f97e29db99b3983d2d50678dcc250da179d32d /src/contest_ai.c | |
parent | cc5db41f30708c1cc2d33a46879c96a9404764a3 (diff) | |
parent | 49bdaeb940afc98e3f98b24c9a5afe1bb8d5d86b (diff) |
Merge branch 'master' of https://github.com/pret/pokeemerald into rebase-install-md
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; |