Skip to content

Commit

Permalink
Fixes dynamicMoveType global not being reset during AI calcs (#5628)
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexOn1ine authored Nov 1, 2024
1 parent 7f52fca commit 2aef530
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/battle_ai_util.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit 2aef530

Please sign in to comment.