Use nullptr as non existing effect.
continuous-integration/drone/push Build is failing Details

This commit is contained in:
Deukhoofd 2020-04-19 19:49:04 +02:00
parent 5146a70d8b
commit 78a42deb90
Signed by: Deukhoofd
GPG Key ID: ADF2E9256009EDCE
1 changed files with 2 additions and 4 deletions

View File

@ -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<uint32_t> _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;