Ensure Attack script is deleted when not taken by ExecutingAttack.
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
2020-05-29 20:05:05 +02:00
parent 20be2815ce
commit a7069a5960
2 changed files with 10 additions and 0 deletions

View File

@@ -63,6 +63,7 @@ void TurnHandler::ExecuteAttackChoice(AttackTurnChoice* choice) {
ArbUt::List<Creature*> targets = {target};
auto attack = ExecutingAttack(targets, 1, choice->GetUser(), choice->GetAttack(), choice->GetAttackScript());
choice->MarkScriptAsTaken();
bool prevented = false;
HOOK_LOCAL(PreventAttack, attack, &attack, &prevented);
if (prevented) {