From 7be7ecfa51559d25b76a657a324547080228879d Mon Sep 17 00:00:00 2001 From: Joggel19 Date: Mon, 19 Jun 2023 18:07:54 +0200 Subject: [PATCH] fixed AI considering status priority moves for AI_WhoStrikesFirst --- src/battle_ai_util.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/battle_ai_util.c b/src/battle_ai_util.c index 7730604c8..b4514701a 100644 --- a/src/battle_ai_util.c +++ b/src/battle_ai_util.c @@ -1096,10 +1096,11 @@ u8 AI_WhoStrikesFirst(u8 battlerAI, u8 battler2, u16 moveConsidered) prioAI = GetMovePriority(battlerAI, moveConsidered); for (i = 0; i < MAX_MON_MOVES; i++) { - if (battler2Moves[i] == 0 || battler2Moves[i] == 0xFFFF) + prioBattler2 = GetMovePriority(battler2, battler2Moves[i]); + if (battler2Moves[i] == 0 || battler2Moves[i] == 0xFFFF + || (prioBattler2 > prioAI && !CanIndexMoveFaintTarget(battler2, battlerAI, i , 2))) continue; - prioBattler2 = GetMovePriority(battler2, battler2Moves[i]); if (prioAI > prioBattler2) fasterAI++; else if (prioBattler2 > prioAI)