Skip to content

Commit

Permalink
Fix Switcheroo giving score even if the opponent has no held item (#5412
Browse files Browse the repository at this point in the history
)
  • Loading branch information
kittenchilly authored Sep 21, 2024
1 parent 68c51f8 commit f7d2e62
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/battle_ai_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -4065,7 +4065,7 @@ static u32 AI_CalcMoveEffectScore(u32 battlerAtk, u32 battlerDef, u32 move)
ADJUST_SCORE(DECENT_EFFECT); // Force 'em out next turn
break;
default:
if (move != MOVE_BESTOW && aiData->items[battlerAtk] == ITEM_NONE)
if (move != MOVE_BESTOW && aiData->items[battlerAtk] == ITEM_NONE && aiData->items[battlerDef] != ITEM_NONE)
{
switch (aiData->holdEffects[battlerDef])
{
Expand Down

0 comments on commit f7d2e62

Please sign in to comment.