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:
@@ -21,7 +21,7 @@ Battling::Creature::Creature(const BattleLibrary* library,
|
||||
AssertNotNull(species)
|
||||
AssertNotNull(variant)
|
||||
|
||||
_activeTalent = _library->LoadScript(ScriptCategory::Talent, GetActiveTalent());
|
||||
_activeTalent = std::unique_ptr<Script>(_library->LoadScript(ScriptCategory::Talent, GetActiveTalent()));
|
||||
if (_nickname.empty()) {
|
||||
_nickname = species->GetName().std_str();
|
||||
}
|
||||
@@ -142,9 +142,8 @@ void Battling::Creature::Heal(uint32_t amount, bool canRevive) {
|
||||
void Battling::Creature::OverrideActiveTalent(const ConstString& talent) {
|
||||
_hasOverridenTalent = true;
|
||||
_activeTalent->OnRemove();
|
||||
delete _activeTalent;
|
||||
_overridenTalentName = talent;
|
||||
_activeTalent = this->_library->LoadScript(ScriptCategory::Talent, talent);
|
||||
_activeTalent.reset(this->_library->LoadScript(ScriptCategory::Talent, talent));
|
||||
}
|
||||
|
||||
const ArbUt::List<uint8_t>& Battling::Creature::GetTypes() const noexcept {
|
||||
|
||||
Reference in New Issue
Block a user