From 06c4a37b1f6baf640b9887852b16c68ba3718672 Mon Sep 17 00:00:00 2001 From: Alex <93446519+AlexOn1ine@users.noreply.github.com> Date: Fri, 28 Mar 2025 15:52:50 +0100 Subject: [PATCH] Remove potential pitfall with saved damage for recoil moves (#6485) --- src/battle_script_commands.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/battle_script_commands.c b/src/battle_script_commands.c index e7ed8aea98..a885191853 100644 --- a/src/battle_script_commands.c +++ b/src/battle_script_commands.c @@ -6406,10 +6406,9 @@ static void Cmd_moveend(void) else if (moveEffect == EFFECT_RECOIL && !(gBattleStruct->moveResultFlags[gBattlerTarget] & MOVE_RESULT_NO_EFFECT) && IsBattlerAlive(gBattlerAttacker) - && IsBattlerTurnDamaged(gBattlerTarget) - && gBattleScripting.savedDmg != 0) // Some checks may be redundant alongside this one + && IsBattlerTurnDamaged(gBattlerTarget)) { - gBattleStruct->moveDamage[gBattlerAttacker] = max(1, gBattleScripting.savedDmg * max(1, moveRecoil) / 100); + gBattleStruct->moveDamage[gBattlerAttacker] = max(1, gBattleStruct->moveDamage[gBattlerTarget] * max(1, moveRecoil) / 100); BattleScriptPushCursor(); gBattlescriptCurrInstr = BattleScript_MoveEffectRecoil; effect = TRUE;