Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix uninitialized ai modifier variable in ai calc damage #2731

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion src/battle_ai_util.c
Original file line number Diff line number Diff line change
Expand Up @@ -802,6 +802,7 @@ s32 AI_CalcDamage(u16 move, u8 battlerAtk, u8 battlerDef, u8 *typeEffectiveness,
}
else
{
effectivenessMultiplier = CalcTypeEffectivenessMultiplier(move, moveType, battlerAtk, battlerDef, FALSE);
dmg = 0;
}

Expand Down Expand Up @@ -1166,7 +1167,7 @@ s32 AI_GetAbility(u32 battlerId)
// We've had ability overwritten by e.g. Worry Seed. It is not part of AI_PARTY in case of switching
if (gBattleStruct->overwrittenAbilities[battlerId])
return gBattleStruct->overwrittenAbilities[battlerId];

// The AI knows its own ability.
if (IsBattlerAIControlled(battlerId))
return knownAbility;
Expand Down