summaryrefslogtreecommitdiff
path: root/src/battle_ai_script_commands.c
diff options
context:
space:
mode:
authorGriffinR <griffin.g.richards@gmail.com>2021-05-16 12:24:04 -0400
committerGitHub <noreply@github.com>2021-05-16 12:24:04 -0400
commit9e690c07edb2219c6c19fc5869a9558cc9df973d (patch)
tree79e3819ea798c409d5903ae252cc97609eba581c /src/battle_ai_script_commands.c
parentab8318cc79de60413085b104125490cbae344169 (diff)
parenta7e3da2301aa7913f2437fe2152efcec6e96faef (diff)
Merge pull request #1437 from ExpoSeed/bugfixes
Various BUGFIXes and UBFIXes
Diffstat (limited to 'src/battle_ai_script_commands.c')
-rw-r--r--src/battle_ai_script_commands.c7
1 files changed, 6 insertions, 1 deletions
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;