Rework script handling to use smart pointers properly
Some checks failed
continuous-integration/drone/push Build is failing

This commit is contained in:
2022-05-14 16:07:32 +02:00
parent 0117cb9d64
commit de6d39376f
17 changed files with 85 additions and 77 deletions

View File

@@ -115,8 +115,9 @@ void TurnHandler::ExecuteAttackChoice(const ArbUt::BorrowedPtr<AttackTurnChoice>
return;
}
auto attackScoped = ArbUt::ScopedPtr<ExecutingAttack>(new ExecutingAttack(
targets, numberHits, choice->GetUser(), choice->GetAttack(), attackData, choice->GetAttackScript()));
auto attackScoped = ArbUt::ScopedPtr<ExecutingAttack>(
new ExecutingAttack(targets, numberHits, choice->GetUser(), choice->GetAttack(), attackData,
choice->GetAttackScript().TakeOwnership()));
bool prevented = false;
HOOK(PreventAttack, attackScoped, attackScoped, &prevented);
if (prevented) {