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:
@@ -47,7 +47,7 @@ namespace CreatureLib::Battling {
|
||||
|
||||
std::string _nickname = "";
|
||||
CreatureLib::Library::TalentIndex _talentIndex;
|
||||
Script* _activeTalent = nullptr;
|
||||
std::unique_ptr<Script> _activeTalent = nullptr;
|
||||
|
||||
bool _hasOverridenTalent;
|
||||
ArbUt::CaseInsensitiveConstString _overridenTalentName = ""_cnc;
|
||||
@@ -56,7 +56,7 @@ namespace CreatureLib::Battling {
|
||||
ArbUt::UniquePtrList<LearnedAttack> _attacks;
|
||||
bool _allowedExperienceGain;
|
||||
|
||||
Script* _status = nullptr;
|
||||
std::unique_ptr<Script> _status = nullptr;
|
||||
ScriptSet _volatile = {};
|
||||
|
||||
private:
|
||||
@@ -70,10 +70,7 @@ namespace CreatureLib::Battling {
|
||||
const Library::TalentIndex& talent, const std::vector<LearnedAttack*>& attacks,
|
||||
bool allowedExperienceGain = true);
|
||||
|
||||
virtual ~Creature() {
|
||||
delete _activeTalent;
|
||||
delete _status;
|
||||
};
|
||||
virtual ~Creature() = default;
|
||||
|
||||
virtual void Initialize() {
|
||||
RecalculateFlatStats();
|
||||
|
||||
Reference in New Issue
Block a user