mirror of
https://github.com/rh-hideout/pokeemerald-expansion.git
synced 2026-04-26 18:27:04 -05:00
Avoid illegal move retargeting in singles (#8217)
This commit is contained in:
parent
586571391f
commit
555c603b67
|
|
@ -545,6 +545,7 @@ void HandleAction_UseMove(void)
|
|||
gBattlerTarget = gBattleStruct->moveTarget[gBattlerAttacker];
|
||||
if (!IsBattlerAlive(gBattlerTarget)
|
||||
&& moveTarget != MOVE_TARGET_OPPONENTS_FIELD
|
||||
&& IsDoubleBattle()
|
||||
&& (!IsBattlerAlly(gBattlerAttacker, gBattlerTarget)))
|
||||
{
|
||||
gBattlerTarget = GetBattlerAtPosition(BATTLE_PARTNER(GetBattlerPosition(gBattlerTarget)));
|
||||
|
|
@ -6216,7 +6217,7 @@ u32 GetBattleMoveTarget(u16 move, u8 setTarget)
|
|||
case MOVE_TARGET_BOTH:
|
||||
case MOVE_TARGET_FOES_AND_ALLY:
|
||||
targetBattler = GetOpposingSideBattler(gBattlerAttacker);
|
||||
if (!IsBattlerAlive(targetBattler))
|
||||
if (IsDoubleBattle() && !IsBattlerAlive(targetBattler))
|
||||
targetBattler ^= BIT_FLANK;
|
||||
break;
|
||||
case MOVE_TARGET_OPPONENTS_FIELD:
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user