Use BUGFIX for some inline fixes

This commit is contained in:
GriffinR
2020-12-12 23:28:01 -05:00
parent ba3021db64
commit 81d95b9325
22 changed files with 157 additions and 46 deletions
+8 -2
View File
@@ -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;