From 78a42deb908ce8e11b88d20dec327b5d6c005a84 Mon Sep 17 00:00:00 2001 From: Deukhoofd Date: Sun, 19 Apr 2020 19:49:04 +0200 Subject: [PATCH] Use nullptr as non existing effect. --- src/Library/Attacks/AttackData.hpp | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/Library/Attacks/AttackData.hpp b/src/Library/Attacks/AttackData.hpp index c8289ac..428aa30 100644 --- a/src/Library/Attacks/AttackData.hpp +++ b/src/Library/Attacks/AttackData.hpp @@ -21,7 +21,7 @@ namespace CreatureLib::Library { uint8_t _baseUsages; AttackTarget _target; int8_t _priority; - const SecondaryEffect* _effect; + const SecondaryEffect* _effect = nullptr; std::unordered_set _flags; public: @@ -38,9 +38,7 @@ namespace CreatureLib::Library { inline uint8_t GetBaseUsages() const noexcept { return _baseUsages; } inline AttackTarget GetTarget() const noexcept { return _target; } inline int8_t GetPriority() const noexcept { return _priority; } - inline bool HasSecondaryEffect() const noexcept { - return _effect->GetChance() != 0 && _effect->GetEffectName() != ""_cnc; - } + inline bool HasSecondaryEffect() const noexcept { return _effect != nullptr; } inline const SecondaryEffect* GetSecondaryEffect() const noexcept { return _effect; } bool HasFlag(const ConstString& key) const noexcept;