mirror of
https://github.com/rh-hideout/pokeemerald-expansion.git
synced 2026-03-21 18:04:50 -05:00
Fix ally targeting moves crashing in single battles (#9433)
This commit is contained in:
parent
f2af06983a
commit
8dd4135b46
|
|
@ -465,6 +465,9 @@ static void OpponentHandleChooseMove(enum BattlerId battler)
|
|||
if (target == TARGET_USER)
|
||||
gBattlerTarget = battler;
|
||||
|
||||
if (target == TARGET_ALLY)
|
||||
gBattlerTarget = BATTLE_PARTNER(battler);
|
||||
|
||||
if (target == TARGET_BOTH)
|
||||
{
|
||||
gBattlerTarget = GetBattlerAtPosition(B_POSITION_PLAYER_LEFT);
|
||||
|
|
@ -500,6 +503,10 @@ static void OpponentHandleChooseMove(enum BattlerId battler)
|
|||
{
|
||||
BtlController_EmitTwoReturnValues(battler, B_COMM_TO_ENGINE, B_ACTION_EXEC_SCRIPT, (chosenMoveIndex) | (battler << 8));
|
||||
}
|
||||
else if (moveTarget == TARGET_ALLY)
|
||||
{
|
||||
BtlController_EmitTwoReturnValues(battler, B_COMM_TO_ENGINE, B_ACTION_EXEC_SCRIPT, (chosenMoveIndex) | (BATTLE_PARTNER(battler) << 8));
|
||||
}
|
||||
else if (IsDoubleBattle())
|
||||
{
|
||||
enum BattlerId targetBattler;
|
||||
|
|
|
|||
|
|
@ -718,6 +718,8 @@ void HandleInputChooseMove(enum BattlerId battler)
|
|||
|
||||
if (isUserOrAlly)
|
||||
gMultiUsePlayerCursor = battler;
|
||||
else if (moveTarget == TARGET_ALLY)
|
||||
gMultiUsePlayerCursor = BATTLE_PARTNER(battler);
|
||||
else
|
||||
gMultiUsePlayerCursor = GetOpposingSideBattler(battler);
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user