Change script when ChangeAttack script hook changes the used attack.
All checks were successful
continuous-integration/drone/push Build is passing

Signed-off-by: Deukhoofd <Deukhoofd@gmail.com>
This commit is contained in:
2021-05-14 10:42:05 +02:00
parent 13153b3119
commit b48353822c
2 changed files with 11 additions and 4 deletions

View File

@@ -89,6 +89,7 @@ void TurnHandler::ExecuteAttackChoice(const ArbUt::BorrowedPtr<AttackTurnChoice>
HOOK(ChangeAttack, choice, choice.GetRaw(), &attackName);
if (attackName != choice->GetAttack()->GetAttack()->GetName()) {
attackData = battle.GetValue()->GetLibrary()->GetAttackLibrary()->Get(attackName);
choice->ChangeAttackScript(attackData);
}
auto targetType = attackData->GetTarget();