From 1ee841146f370b12e67489683d7f5eafd6a35596 Mon Sep 17 00:00:00 2001 From: BuffelSaft Date: Sat, 2 Oct 2021 15:08:15 +1300 Subject: [PATCH] Fix recoil occurring on zero damage attack The "x was hit with recoil!" message was appearing when the target was immune due to protection or an ability - this should fix that and handle any other cases where 0 damage is dealt. --- src/battle_script_commands.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/battle_script_commands.c b/src/battle_script_commands.c index b0508b80b..aa85b5d30 100644 --- a/src/battle_script_commands.c +++ b/src/battle_script_commands.c @@ -4793,7 +4793,8 @@ static void Cmd_moveend(void) case MOVEEND_RECOIL: if (!(gMoveResultFlags & MOVE_RESULT_NO_EFFECT) && !(gHitMarker & HITMARKER_UNABLE_TO_USE_MOVE) - && IsBattlerAlive(gBattlerAttacker)) + && IsBattlerAlive(gBattlerAttacker) + && gBattleScripting.savedDmg != 0) // Some checks may be redundant alongside this one { switch (gBattleMoves[gCurrentMove].effect) {