trysethelpinghand avoid illegal target (#8218)
This commit is contained in:
parent
2bb0d0249d
commit
16d80e9bb1
@ -12643,11 +12643,16 @@ static void Cmd_trysethelpinghand(void)
|
||||
{
|
||||
CMD_ARGS(const u8 *failInstr);
|
||||
|
||||
if (!IsDoubleBattle())
|
||||
{
|
||||
gBattlescriptCurrInstr = cmd->failInstr;
|
||||
return;
|
||||
}
|
||||
|
||||
gBattlerTarget = GetBattlerAtPosition(BATTLE_PARTNER(GetBattlerPosition(gBattlerAttacker)));
|
||||
|
||||
if (IsDoubleBattle()
|
||||
&& !(gAbsentBattlerFlags & (1u << gBattlerTarget))
|
||||
&& !HasBattlerActedThisTurn(gBattlerTarget))
|
||||
if (!(gAbsentBattlerFlags & (1u << gBattlerTarget))
|
||||
&& !HasBattlerActedThisTurn(gBattlerTarget))
|
||||
{
|
||||
gProtectStructs[gBattlerTarget].helpingHand++;
|
||||
gBattlescriptCurrInstr = cmd->nextInstr;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user