Use smart pointers for BattleSide.
Some checks failed
continuous-integration/drone/push Build is failing
Some checks failed
continuous-integration/drone/push Build is failing
This commit is contained in:
@@ -8,11 +8,11 @@ using namespace CreatureLib::Battling;
|
||||
void TurnHandler::RunTurn(ArbUt::BorrowedPtr<ChoiceQueue> queue) {
|
||||
AssertNotNull(queue)
|
||||
for (auto choice : queue->GetInnerQueue()) {
|
||||
HOOK(OnBeforeTurn, choice, choice);
|
||||
HOOK(OnBeforeTurn, choice, choice.get());
|
||||
}
|
||||
while (queue->HasNext()) {
|
||||
auto item = queue->Dequeue();
|
||||
ExecuteChoice(item);
|
||||
ExecuteChoice(item.get());
|
||||
}
|
||||
queue->HasCompletedQueue = true;
|
||||
}
|
||||
@@ -59,7 +59,7 @@ void TurnHandler::ExecuteAttackChoice(ArbUt::BorrowedPtr<AttackTurnChoice> choic
|
||||
|
||||
// FIXME: Resolve all targets
|
||||
auto target = choice->GetUser()->GetBattle()->GetCreature(choice->GetTarget());
|
||||
ArbUt::List<Creature*> targets = {target};
|
||||
ArbUt::List<ArbUt::BorrowedPtr<Creature>> targets = {target};
|
||||
|
||||
auto attack = ExecutingAttack(targets, 1, choice->GetUser(), choice->GetAttack(), choice->GetAttackScript());
|
||||
choice->MarkScriptAsTaken();
|
||||
@@ -91,7 +91,7 @@ void TurnHandler::ExecuteAttackChoice(ArbUt::BorrowedPtr<AttackTurnChoice> choic
|
||||
HOOK_LOCAL(OnBeforeAttack, attack, &attack);
|
||||
|
||||
for (auto& t : attack.GetTargets()) {
|
||||
HandleAttackForTarget(&attack, t);
|
||||
HandleAttackForTarget(&attack, t.GetRaw());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user