From 3bd680cab9b5992fa7aa2337fb0c50e8f66df15f Mon Sep 17 00:00:00 2001 From: ghoulslash Date: Tue, 21 Mar 2023 13:36:45 -0400 Subject: [PATCH 1/3] fix GetBattleAnimMoveTargets for non-player gBattleAnimAttacker --- src/battle_anim.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/battle_anim.c b/src/battle_anim.c index fd81152e1c..984f7b0a9d 100644 --- a/src/battle_anim.c +++ b/src/battle_anim.c @@ -440,22 +440,22 @@ static u8 GetBattleAnimMoveTargets(u8 battlerArgIndex, u8 *targets) case MOVE_TARGET_BOTH: targets[0] = gBattleAnimArgs[battlerArgIndex]; numTargets = 1; - if (IsBattlerAlive(targets[0] ^ BIT_FLANK)) { - targets[1] = targets[0] ^ BIT_FLANK; - numTargets++; + if (IsBattlerAlive(BATTLE_PARTNER(targets[0])) { + targets[1] = BATTLE_PARTNER(targets[0]); + numTargets = 2; } break; case MOVE_TARGET_FOES_AND_ALLY: targets[0] = gBattleAnimArgs[battlerArgIndex]; numTargets = 1; - if (IsBattlerAlive(targets[0] ^ BIT_FLANK)) { - targets[1] = targets[0] ^ BIT_FLANK; + if (IsBattlerAlive(BATTLE_PARTNER(targets[0]))) { + targets[1] = BATTLE_PARTNER(targets[0]); numTargets++; } - - if (IsBattlerAlive(gBattleAnimAttacker ^ BIT_FLANK)) { - targets[2] = gBattleAnimAttacker ^ BIT_FLANK; + + if (IsBattlerAlive(BATTLE_PARTNER(BATTLE_OPPOSITE(targets[0])))) { + targets[2] = BATTLE_PARTNER(BATTLE_OPPOSITE(targets[0])); numTargets++; } break; From 1adc6b761e19a716d42ccf76d68a8996ae89a3a5 Mon Sep 17 00:00:00 2001 From: ghoulslash Date: Tue, 21 Mar 2023 13:38:24 -0400 Subject: [PATCH 2/3] remove random space --- src/battle_anim.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/battle_anim.c b/src/battle_anim.c index 984f7b0a9d..0c688f20bb 100644 --- a/src/battle_anim.c +++ b/src/battle_anim.c @@ -453,7 +453,7 @@ static u8 GetBattleAnimMoveTargets(u8 battlerArgIndex, u8 *targets) targets[1] = BATTLE_PARTNER(targets[0]); numTargets++; } - + if (IsBattlerAlive(BATTLE_PARTNER(BATTLE_OPPOSITE(targets[0])))) { targets[2] = BATTLE_PARTNER(BATTLE_OPPOSITE(targets[0])); numTargets++; From c61797bc38e5cdb60393b19b987b96e4075d3bb2 Mon Sep 17 00:00:00 2001 From: ghoulslash Date: Tue, 21 Mar 2023 14:31:09 -0400 Subject: [PATCH 3/3] styling and syntax fix --- src/battle_anim.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/battle_anim.c b/src/battle_anim.c index 0c688f20bb..4191fe7aa1 100644 --- a/src/battle_anim.c +++ b/src/battle_anim.c @@ -440,7 +440,8 @@ static u8 GetBattleAnimMoveTargets(u8 battlerArgIndex, u8 *targets) case MOVE_TARGET_BOTH: targets[0] = gBattleAnimArgs[battlerArgIndex]; numTargets = 1; - if (IsBattlerAlive(BATTLE_PARTNER(targets[0])) { + if (IsBattlerAlive(BATTLE_PARTNER(targets[0]))) + { targets[1] = BATTLE_PARTNER(targets[0]); numTargets = 2; } @@ -448,13 +449,14 @@ static u8 GetBattleAnimMoveTargets(u8 battlerArgIndex, u8 *targets) case MOVE_TARGET_FOES_AND_ALLY: targets[0] = gBattleAnimArgs[battlerArgIndex]; numTargets = 1; - - if (IsBattlerAlive(BATTLE_PARTNER(targets[0]))) { + if (IsBattlerAlive(BATTLE_PARTNER(targets[0]))) + { targets[1] = BATTLE_PARTNER(targets[0]); numTargets++; } - if (IsBattlerAlive(BATTLE_PARTNER(BATTLE_OPPOSITE(targets[0])))) { + if (IsBattlerAlive(BATTLE_PARTNER(BATTLE_OPPOSITE(targets[0])))) + { targets[2] = BATTLE_PARTNER(BATTLE_OPPOSITE(targets[0])); numTargets++; }