Make LearnedAttack of Creature a smart pointer.
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
2020-05-31 17:26:39 +02:00
parent a7069a5960
commit ff181204ae
8 changed files with 25 additions and 21 deletions

View File

@@ -56,10 +56,10 @@ Creature* CreateCreature::Create() {
}
auto experience = _library->GetGrowthRateLibrary()->CalculateExperience(species->GetGrowthRate(), _level);
auto attacks = ArbUt::List<LearnedAttack*>(_attacks.Count());
auto attacks = std::vector<LearnedAttack*>(_attacks.Count());
for (size_t i = 0; i < _attacks.Count(); i++) {
auto kv = _attacks[i];
attacks.Append(new LearnedAttack(std::get<0>(kv), std::get<1>(kv)));
attacks[i] = new LearnedAttack(std::get<0>(kv), std::get<1>(kv));
}
auto c = new Creature(_library, species, variant, _level, experience, identifier, gender, _coloring, heldItem,
_nickname, talent, attacks);