Actually implement handling of StopBeforeAttack script hook
continuous-integration/drone/push Build is passing
Details
continuous-integration/drone/push Build is passing
Details
This commit is contained in:
parent
c6620021a7
commit
cd7ddcf78e
|
@ -82,7 +82,11 @@ void TurnHandler::ExecuteAttackChoice(AttackTurnChoice* choice) {
|
|||
return;
|
||||
}
|
||||
|
||||
HOOK(StopBeforeAttack, attack, attack);
|
||||
bool stopBeforeAttack = false;
|
||||
HOOK(StopBeforeAttack, attack, attack, &stopBeforeAttack);
|
||||
if (stopBeforeAttack) {
|
||||
return;
|
||||
}
|
||||
HOOK(OnBeforeAttack, attack, attack);
|
||||
|
||||
for (auto& kv : attack->GetTargets()) {
|
||||
|
|
|
@ -30,7 +30,7 @@ namespace CreatureLib::Battling {
|
|||
virtual void ChangeAttack(AttackTurnChoice* choice, std::string* outAttack){};
|
||||
virtual void PreventAttack(ExecutingAttack* attack, bool* outResult){};
|
||||
virtual void FailAttack(ExecutingAttack* attack, bool* outFailed){};
|
||||
virtual void StopBeforeAttack(ExecutingAttack* attack){};
|
||||
virtual void StopBeforeAttack(ExecutingAttack* attack, bool* outResult){};
|
||||
virtual void OnBeforeAttack(ExecutingAttack* attack){};
|
||||
|
||||
virtual void FailIncomingAttack(ExecutingAttack* attack, Creature* target, bool* outResult){};
|
||||
|
|
Loading…
Reference in New Issue