From 361fa594b30005edaa8aef5f6b02ac8b15149cba Mon Sep 17 00:00:00 2001 From: ExpoSeed <> Date: Sat, 15 May 2021 15:56:17 -0500 Subject: Various BUGFIXes and UBFIXes --- src/battle_ai_script_commands.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'src/battle_ai_script_commands.c') diff --git a/src/battle_ai_script_commands.c b/src/battle_ai_script_commands.c index 9fdd4d0c3..81e7c15cc 100644 --- a/src/battle_ai_script_commands.c +++ b/src/battle_ai_script_commands.c @@ -1877,9 +1877,14 @@ static void Cmd_if_has_move_with_effect(void) case AI_TARGET_PARTNER: for (i = 0; i < MAX_MON_MOVES; i++) { - // UB: checks sBattler_AI instead of gBattlerTarget. + // BUG: checks sBattler_AI instead of gBattlerTarget. + #ifndef BUGFIX if (gBattleMons[sBattler_AI].moves[i] != 0 && gBattleMoves[BATTLE_HISTORY->usedMoves[gBattlerTarget].moves[i]].effect == gAIScriptPtr[2]) break; + #else + if (gBattleMons[gBattlerTarget].moves[i] != 0 && gBattleMoves[BATTLE_HISTORY->usedMoves[gBattlerTarget].moves[i]].effect == gAIScriptPtr[2]) + break; + #endif } if (i == MAX_MON_MOVES) gAIScriptPtr += 7; -- cgit v1.2.3