From 2aef530bfa23cc60eaa3b93d7f700fcd2645be04 Mon Sep 17 00:00:00 2001 From: Alex <93446519+AlexOn1ine@users.noreply.github.com> Date: Fri, 1 Nov 2024 11:10:17 +0100 Subject: [PATCH] Fixes dynamicMoveType global not being reset during AI calcs (#5628) --- src/battle_ai_util.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/battle_ai_util.c b/src/battle_ai_util.c index b7ab186cccd2..d3f37f34a026 100644 --- a/src/battle_ai_util.c +++ b/src/battle_ai_util.c @@ -561,8 +561,6 @@ struct SimulatedDamage AI_CalcDamage(u32 move, u32 battlerAtk, u32 battlerDef, u break; } - gBattleStruct->dynamicMoveType = 0; - SetTypeBeforeUsingMove(move, battlerAtk); GET_MOVE_TYPE(move, moveType); effectivenessMultiplier = CalcTypeEffectivenessMultiplier(move, moveType, battlerAtk, battlerDef, aiData->abilities[battlerDef], FALSE); @@ -734,6 +732,7 @@ struct SimulatedDamage AI_CalcDamage(u32 move, u32 battlerAtk, u32 battlerDef, u *typeEffectiveness = AI_GetEffectiveness(effectivenessMultiplier); // Undo temporary settings + gBattleStruct->dynamicMoveType = 0; gBattleStruct->aiCalcInProgress = FALSE; gBattleStruct->swapDamageCategory = FALSE; gBattleStruct->zmove.baseMoves[battlerAtk] = MOVE_NONE;