From ef4b34f77fb4a5b7d8fa57816b7b05287930d90c Mon Sep 17 00:00:00 2001 From: DizzyEggg Date: Thu, 23 Feb 2023 09:53:57 +0100 Subject: [PATCH] fix uninitialized ai modifier variable in ai calc damage --- src/battle_ai_util.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/battle_ai_util.c b/src/battle_ai_util.c index 531a4aa6b754..4641ba2cdd77 100644 --- a/src/battle_ai_util.c +++ b/src/battle_ai_util.c @@ -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; } @@ -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;