Support for failing an AttackTurnChoice.
All checks were successful
continuous-integration/drone/push Build is passing

This is handled before the actual ExecutingAttack is created, so allows for failing a move a lot earlier than before.
This commit is contained in:
2021-11-12 12:54:05 +01:00
parent 1a3b7fe50a
commit 33d384c464
2 changed files with 9 additions and 0 deletions

View File

@@ -134,6 +134,11 @@ void TurnHandler::ExecuteAttackChoice(const ArbUt::BorrowedPtr<AttackTurnChoice>
return;
}
if (choice->HasFailed()) {
FAIL_HANDLING_NO_TARGET(choice, choice->GetUser());
return;
}
auto* attack = attackScoped.TakeOwnership();
battle.GetValue()->TriggerEventListener<AttackUseEvent>(attack);
battle.GetValue()->RegisterHistoryElement<AttackUseHistory>(attack);