From 86b76134e35f70298aa259cd099fdf9e359e2866 Mon Sep 17 00:00:00 2001 From: Alex <93446519+AlexOn1ine@users.noreply.github.com> Date: Sun, 2 Jun 2024 15:31:10 +0200 Subject: [PATCH] replace gCurrentMove with move in CalcCritChanceStageArgs (#4687) AI got the wrong calc when the global was used. --- src/battle_script_commands.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/battle_script_commands.c b/src/battle_script_commands.c index 459c6007f7..621b2c2312 100644 --- a/src/battle_script_commands.c +++ b/src/battle_script_commands.c @@ -1923,7 +1923,7 @@ s32 CalcCritChanceStageArgs(u32 battlerAtk, u32 battlerDef, u32 move, bool32 rec critChance = -1; } else if (gStatuses3[battlerAtk] & STATUS3_LASER_FOCUS - || gMovesInfo[gCurrentMove].alwaysCriticalHit + || gMovesInfo[move].alwaysCriticalHit || (abilityAtk == ABILITY_MERCILESS && gBattleMons[battlerDef].status1 & STATUS1_PSN_ANY)) { critChance = -2; @@ -1932,7 +1932,7 @@ s32 CalcCritChanceStageArgs(u32 battlerAtk, u32 battlerDef, u32 move, bool32 rec { critChance = 2 * ((gBattleMons[battlerAtk].status2 & STATUS2_FOCUS_ENERGY) != 0) + 1 * ((gBattleMons[battlerAtk].status2 & STATUS2_DRAGON_CHEER) != 0) - + gMovesInfo[gCurrentMove].criticalHitStage + + gMovesInfo[move].criticalHitStage + (holdEffectAtk == HOLD_EFFECT_SCOPE_LENS) + 2 * (holdEffectAtk == HOLD_EFFECT_LUCKY_PUNCH && gBattleMons[battlerAtk].species == SPECIES_CHANSEY) + 2 * BENEFITS_FROM_LEEK(battlerAtk, holdEffectAtk)