Make all individual scripts smart pointers.
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:
@@ -5,9 +5,9 @@ using namespace CreatureLib::Battling;
|
||||
export uint8_t CreatureLib_ExecutingAttack_Construct(ExecutingAttack*& out, Creature* const* targets,
|
||||
size_t targetCount, uint8_t numberHits, Creature* user,
|
||||
LearnedAttack* attack, Script* script) {
|
||||
Try(auto ls = ArbUt::List<ArbUt::BorrowedPtr<Creature>>(targetCount); for (size_t i = 0; i < targetCount; i++) {
|
||||
ls.Append(targets[i]);
|
||||
} out = new ExecutingAttack(ls, numberHits, user, attack, script);)
|
||||
Try(auto ls = ArbUt::List<ArbUt::BorrowedPtr<Creature>>(targetCount);
|
||||
for (size_t i = 0; i < targetCount; i++) { ls.Append(targets[i]); } auto s = std::unique_ptr<Script>(script);
|
||||
out = new ExecutingAttack(ls, numberHits, user, attack, s);)
|
||||
}
|
||||
|
||||
export void CreatureLib_ExecutingAttack_Destruct(ExecutingAttack* p) { delete p; }
|
||||
|
||||
@@ -30,7 +30,7 @@ SIMPLE_GET_FUNC(AttackTurnChoice, GetKind, TurnChoiceKind)
|
||||
|
||||
export uint8_t CreatureLib_BaseTurnChoice_GetPriority(int8_t& out, AttackTurnChoice* p) { Try(out = p->GetPriority()); }
|
||||
|
||||
SIMPLE_GET_FUNC(AttackTurnChoice, GetAttackScript, Script*)
|
||||
SIMPLE_GET_FUNC_SMART_PTR(AttackTurnChoice, GetAttackScript, Script*)
|
||||
export uint8_t CreatureLib_BaseTurnChoice_GetTargetSideIndex(const AttackTurnChoice* p) {
|
||||
return p->GetTarget().GetSideIndex();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user