Adds choice pointer to flee prevention script.
continuous-integration/drone/push Build is passing Details

Signed-off-by: Deukhoofd <Deukhoofd@gmail.com>
This commit is contained in:
Deukhoofd 2021-03-27 15:10:56 +01:00
parent 4dd3700352
commit d6858c2d44
Signed by: Deukhoofd
GPG Key ID: F63E044490819F6F
2 changed files with 6 additions and 4 deletions

View File

@ -274,7 +274,7 @@ void TurnHandler::ExecuteFleeChoice(const ArbUt::BorrowedPtr<FleeTurnChoice>& 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<FleeTurnChoice>& ch
if (!creature.HasValue()) {
continue;
}
HOOK(PreventOpponentRunAway, creature.GetValue(), &preventRun);
HOOK(PreventOpponentRunAway, creature.GetValue(), choice, &preventRun);
if (preventRun) {
return;
}

View File

@ -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){};
};
}