From 06fefe33186845d3bd851a3bcf18f8eeb7d33346 Mon Sep 17 00:00:00 2001 From: ghoulslash <41651341+ghoulslash@users.noreply.github.com> Date: Sun, 6 Oct 2024 15:05:29 -0400 Subject: [PATCH] Various AI fixes (#5474) * fix AI mirror move check viability call * fix EFFECT_ABSORB missing break in AI_CalcMoveEffectScore --------- Co-authored-by: ghoulslash --- src/battle_ai_main.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/battle_ai_main.c b/src/battle_ai_main.c index 903b0c7d9f85..e41be6971c98 100644 --- a/src/battle_ai_main.c +++ b/src/battle_ai_main.c @@ -3302,6 +3302,7 @@ static u32 AI_CalcMoveEffectScore(u32 battlerAtk, u32 battlerDef, u32 move) case EFFECT_ABSORB: if (aiData->holdEffects[battlerAtk] == HOLD_EFFECT_BIG_ROOT && effectiveness >= AI_EFFECTIVENESS_x1) ADJUST_SCORE(DECENT_EFFECT); + break; case EFFECT_EXPLOSION: case EFFECT_MEMENTO: if (AI_THINKING_STRUCT->aiFlags[battlerAtk] & AI_FLAG_WILL_SUICIDE && gBattleMons[battlerDef].statStages[STAT_EVASION] < 7) @@ -3316,7 +3317,7 @@ static u32 AI_CalcMoveEffectScore(u32 battlerAtk, u32 battlerDef, u32 move) break; case EFFECT_MIRROR_MOVE: if (predictedMove != MOVE_NONE) - return AI_CheckViability(battlerAtk, battlerDef, gLastMoves[battlerDef], score); + return AI_CheckViability(battlerAtk, battlerDef, predictedMove, score); break; case EFFECT_ATTACK_UP: case EFFECT_ATTACK_UP_USER_ALLY: