Fixes dynamicMoveType global not being reset during AI calcs (#5628)
This commit is contained in:
parent
7f52fca8fe
commit
2aef530bfa
1 changed files with 1 additions and 2 deletions
|
@ -561,8 +561,6 @@ struct SimulatedDamage AI_CalcDamage(u32 move, u32 battlerAtk, u32 battlerDef, u
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
gBattleStruct->dynamicMoveType = 0;
|
|
||||||
|
|
||||||
SetTypeBeforeUsingMove(move, battlerAtk);
|
SetTypeBeforeUsingMove(move, battlerAtk);
|
||||||
GET_MOVE_TYPE(move, moveType);
|
GET_MOVE_TYPE(move, moveType);
|
||||||
effectivenessMultiplier = CalcTypeEffectivenessMultiplier(move, moveType, battlerAtk, battlerDef, aiData->abilities[battlerDef], FALSE);
|
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);
|
*typeEffectiveness = AI_GetEffectiveness(effectivenessMultiplier);
|
||||||
|
|
||||||
// Undo temporary settings
|
// Undo temporary settings
|
||||||
|
gBattleStruct->dynamicMoveType = 0;
|
||||||
gBattleStruct->aiCalcInProgress = FALSE;
|
gBattleStruct->aiCalcInProgress = FALSE;
|
||||||
gBattleStruct->swapDamageCategory = FALSE;
|
gBattleStruct->swapDamageCategory = FALSE;
|
||||||
gBattleStruct->zmove.baseMoves[battlerAtk] = MOVE_NONE;
|
gBattleStruct->zmove.baseMoves[battlerAtk] = MOVE_NONE;
|
||||||
|
|
Loading…
Reference in a new issue