diff --git a/src/Battling/Flow/TurnHandler.cpp b/src/Battling/Flow/TurnHandler.cpp index 03f42f3..2c63cde 100644 --- a/src/Battling/Flow/TurnHandler.cpp +++ b/src/Battling/Flow/TurnHandler.cpp @@ -274,7 +274,7 @@ void TurnHandler::ExecuteFleeChoice(const ArbUt::BorrowedPtr& ch } bool preventRun = false; - HOOK(PreventRunAway, choice, &preventRun); + HOOK(PreventRunAway, choice, choice, &preventRun); if (preventRun) { return; } @@ -286,7 +286,7 @@ void TurnHandler::ExecuteFleeChoice(const ArbUt::BorrowedPtr& ch if (!creature.HasValue()) { continue; } - HOOK(PreventOpponentRunAway, creature.GetValue(), &preventRun); + HOOK(PreventOpponentRunAway, creature.GetValue(), choice, &preventRun); if (preventRun) { return; } diff --git a/src/Battling/ScriptHandling/BattleScript.hpp b/src/Battling/ScriptHandling/BattleScript.hpp index 64a23ad..2b070e1 100644 --- a/src/Battling/ScriptHandling/BattleScript.hpp +++ b/src/Battling/ScriptHandling/BattleScript.hpp @@ -7,6 +7,7 @@ namespace CreatureLib::Battling { class BaseTurnChoice; class AttackTurnChoice; class SwitchTurnChoice; + class FleeTurnChoice; class ExecutingAttack; class Creature; @@ -79,8 +80,9 @@ namespace CreatureLib::Battling { virtual void OnFail([[maybe_unused]] Creature* target){}; virtual void OnOpponentFail([[maybe_unused]] Creature* target){}; - virtual void PreventRunAway([[maybe_unused]] bool* result){}; - virtual void PreventOpponentRunAway([[maybe_unused]] bool* result){}; + virtual void PreventRunAway([[maybe_unused]] const FleeTurnChoice* choice, [[maybe_unused]] bool* result){}; + virtual void PreventOpponentRunAway([[maybe_unused]] const FleeTurnChoice* choice, + [[maybe_unused]] bool* result){}; }; }