diff --git a/src/Battling/Flow/TurnHandler.cpp b/src/Battling/Flow/TurnHandler.cpp index d97be83..533e3ad 100644 --- a/src/Battling/Flow/TurnHandler.cpp +++ b/src/Battling/Flow/TurnHandler.cpp @@ -224,9 +224,9 @@ void TurnHandler::HandleAttackForTarget(ExecutingAttack* attack, const ArbUt::Bo auto effectiveness = typeLibrary->GetEffectiveness(hitType, target->GetTypes()); HOOK(ChangeEffectiveness, attack, attack, target.GetRaw(), hitIndex, &effectiveness) hit.SetEffectiveness(effectiveness); - bool canBeCritical = true; - HOOK(BlockCritical, attack, attack, target.GetRaw(), hitIndex, &canBeCritical); - if (canBeCritical) { + bool blockCritical = true; + HOOK(BlockCritical, attack, attack, target.GetRaw(), hitIndex, &blockCritical); + if (!blockCritical) { hit.SetCritical(miscLibrary->IsCritical(attack, target.GetRaw(), hitIndex)); } else { hit.SetCritical(false); diff --git a/src/Battling/ScriptHandling/BattleScript.hpp b/src/Battling/ScriptHandling/BattleScript.hpp index 13d244b..2730c73 100644 --- a/src/Battling/ScriptHandling/BattleScript.hpp +++ b/src/Battling/ScriptHandling/BattleScript.hpp @@ -63,7 +63,7 @@ namespace CreatureLib::Battling { virtual void ChangeEffectiveness([[maybe_unused]] ExecutingAttack* attack, [[maybe_unused]] Creature* target, [[maybe_unused]] u8 hitNumber, [[maybe_unused]] float* effectiveness){}; virtual void BlockCritical([[maybe_unused]] ExecutingAttack* attack, [[maybe_unused]] Creature* target, - [[maybe_unused]] u8 hitNumber, [[maybe_unused]] bool* canBeCritical){}; + [[maybe_unused]] u8 hitNumber, [[maybe_unused]] bool* blockCritical){}; virtual void OverrideBasePower([[maybe_unused]] ExecutingAttack* attack, [[maybe_unused]] Creature* target, [[maybe_unused]] u8 hitIndex, [[maybe_unused]] u8* basePower){};