Adds choice pointer to flee prevention script.
continuous-integration/drone/push Build is passing
Details
continuous-integration/drone/push Build is passing
Details
Signed-off-by: Deukhoofd <Deukhoofd@gmail.com>
This commit is contained in:
parent
4dd3700352
commit
d6858c2d44
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -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){};
|
||||
};
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue