Skip to content

Commit

Permalink
Fixes dynamicMoveType global not being reset during AI calcs (rh-hide…
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexOn1ine authored and ivaantxo committed Nov 12, 2024
1 parent b46a2a3 commit ce69942
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
1 change: 1 addition & 0 deletions desarrollo/notas_desarrollo.md
Original file line number Diff line number Diff line change
Expand Up @@ -87,3 +87,4 @@ porytiles compile-primary -Wall -o /Users/ivanmartinez/Desktop/Decompilación/p
*Arreglar .pal de Charmander (y de charmeleon?) No de Charizard.
*Añadir caso de crianza para Latios/Latias y Nidoran.
*¿Cómo criar a Tauros?
*Decouple poké balls de item id
3 changes: 1 addition & 2 deletions src/battle_ai_util.c
Original file line number Diff line number Diff line change
Expand Up @@ -541,8 +541,6 @@ struct SimulatedDamage AI_CalcDamage(u32 move, u32 battlerAtk, u32 battlerDef, u
break;
}

gBattleStruct->dynamicMoveType = 0;

SetTypeBeforeUsingMove(move, battlerAtk);
moveType = GetMoveType(move);
effectivenessMultiplier = CalcTypeEffectivenessMultiplier(move, moveType, battlerAtk, battlerDef, aiData->abilities[battlerDef], FALSE);
Expand Down Expand Up @@ -735,6 +733,7 @@ struct SimulatedDamage AI_CalcDamage(u32 move, u32 battlerAtk, u32 battlerDef, u
*typeEffectiveness = AI_GetEffectiveness(effectivenessMultiplier);

// Undo temporary settings
gBattleStruct->dynamicMoveType = 0;
gBattleStruct->swapDamageCategory = FALSE;
gBattleStruct->zmove.baseMoves[battlerAtk] = MOVE_NONE;
if (toggledGimmick)
Expand Down

0 comments on commit ce69942

Please sign in to comment.