From a9cbaa5966c7a0f5a23517318bad485e08357c80 Mon Sep 17 00:00:00 2001 From: ghoulslash Date: Sat, 4 Sep 2021 08:40:43 -0400 Subject: [PATCH] fix mental herb encore, heal block --- src/battle_util.c | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/src/battle_util.c b/src/battle_util.c index adb0c70ad..81f9cfaf9 100644 --- a/src/battle_util.c +++ b/src/battle_util.c @@ -5605,6 +5605,7 @@ static bool32 UnnerveOn(u32 battlerId, u32 itemId) static bool32 GetMentalHerbEffect(u8 battlerId) { bool32 ret = FALSE; + // Check infatuation if (gBattleMons[battlerId].status2 & STATUS2_INFATUATION) { @@ -5615,18 +5616,18 @@ static bool32 GetMentalHerbEffect(u8 battlerId) } #if B_MENTAL_HERB >= GEN_5 // Check taunt - if (gDisableStructs[gBattlerTarget].tauntTimer != 0) + if (gDisableStructs[battlerId].tauntTimer != 0) { - gDisableStructs[gBattlerTarget].tauntTimer = gDisableStructs[gBattlerTarget].tauntTimer2 = 0; + gDisableStructs[battlerId].tauntTimer = gDisableStructs[battlerId].tauntTimer2 = 0; gBattleCommunication[MULTISTRING_CHOOSER] = MULTI_CURETAUNT; PREPARE_MOVE_BUFFER(gBattleTextBuff1, MOVE_TAUNT); ret = TRUE; } // Check encore - if (gDisableStructs[gBattlerTarget].encoreTimer != 0) + if (gDisableStructs[battlerId].encoreTimer != 0) { - gDisableStructs[gActiveBattler].encoredMove = 0; - gDisableStructs[gBattlerTarget].encoreTimerStartValue = gDisableStructs[gBattlerTarget].encoreTimer = 0; + gDisableStructs[battlerId].encoredMove = 0; + gDisableStructs[battlerId].encoreTimerStartValue = gDisableStructs[battlerId].encoreTimer = 0; gBattleCommunication[MULTISTRING_CHOOSER] = MULTI_CUREENCORE; // STRINGID_PKMNENCOREENDED ret = TRUE; } @@ -5645,10 +5646,10 @@ static bool32 GetMentalHerbEffect(u8 battlerId) ret = TRUE; } // Check disable - if (gDisableStructs[gBattlerTarget].disableTimer != 0) + if (gDisableStructs[battlerId].disableTimer != 0) { - gDisableStructs[gBattlerTarget].disableTimer = gDisableStructs[gBattlerTarget].disableTimerStartValue = 0; - gDisableStructs[gBattlerTarget].disabledMove = 0; + gDisableStructs[battlerId].disableTimer = gDisableStructs[battlerId].disableTimerStartValue = 0; + gDisableStructs[battlerId].disabledMove = 0; gBattleCommunication[MULTISTRING_CHOOSER] = MULTI_CUREDISABLE; ret = TRUE; }