From 16d80e9bb104db9e20dcf5ff17223933459363e4 Mon Sep 17 00:00:00 2001 From: Martin Griffin Date: Wed, 12 Nov 2025 21:53:35 +0000 Subject: [PATCH] trysethelpinghand avoid illegal target (#8218) --- src/battle_script_commands.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/battle_script_commands.c b/src/battle_script_commands.c index b2712aa587..ac9f381291 100644 --- a/src/battle_script_commands.c +++ b/src/battle_script_commands.c @@ -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;