fix GetBattleAnimMoveTargets for non-player gBattleAnimAttacker (#2848)
This commit is contained in:
commit
fa245c6edf
1 changed files with 10 additions and 8 deletions
|
@ -440,22 +440,24 @@ static u8 GetBattleAnimMoveTargets(u8 battlerArgIndex, u8 *targets)
|
||||||
case MOVE_TARGET_BOTH:
|
case MOVE_TARGET_BOTH:
|
||||||
targets[0] = gBattleAnimArgs[battlerArgIndex];
|
targets[0] = gBattleAnimArgs[battlerArgIndex];
|
||||||
numTargets = 1;
|
numTargets = 1;
|
||||||
if (IsBattlerAlive(targets[0] ^ BIT_FLANK)) {
|
if (IsBattlerAlive(BATTLE_PARTNER(targets[0])))
|
||||||
targets[1] = targets[0] ^ BIT_FLANK;
|
{
|
||||||
numTargets++;
|
targets[1] = BATTLE_PARTNER(targets[0]);
|
||||||
|
numTargets = 2;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case MOVE_TARGET_FOES_AND_ALLY:
|
case MOVE_TARGET_FOES_AND_ALLY:
|
||||||
targets[0] = gBattleAnimArgs[battlerArgIndex];
|
targets[0] = gBattleAnimArgs[battlerArgIndex];
|
||||||
numTargets = 1;
|
numTargets = 1;
|
||||||
|
if (IsBattlerAlive(BATTLE_PARTNER(targets[0])))
|
||||||
if (IsBattlerAlive(targets[0] ^ BIT_FLANK)) {
|
{
|
||||||
targets[1] = targets[0] ^ BIT_FLANK;
|
targets[1] = BATTLE_PARTNER(targets[0]);
|
||||||
numTargets++;
|
numTargets++;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (IsBattlerAlive(gBattleAnimAttacker ^ BIT_FLANK)) {
|
if (IsBattlerAlive(BATTLE_PARTNER(BATTLE_OPPOSITE(targets[0]))))
|
||||||
targets[2] = gBattleAnimAttacker ^ BIT_FLANK;
|
{
|
||||||
|
targets[2] = BATTLE_PARTNER(BATTLE_OPPOSITE(targets[0]));
|
||||||
numTargets++;
|
numTargets++;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
Loading…
Reference in a new issue