mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-02-16 16:56:07 +00:00
feat(Core/Unit): New helpers for DynamicFlags (#11230)
* feat(Core/Unit): New helpers for DynamicFlags
* cherry-pick commit (d611925dc7)
Co-Authored-By: Shauren <shauren.trinity@gmail.com>
* oopsie
Co-authored-by: Shauren <shauren.trinity@gmail.com>
This commit is contained in:
@@ -583,7 +583,7 @@ uint32 Object::GetUpdateFieldData(Player const* target, uint32*& flags) const
|
||||
if (ToUnit()->GetOwnerGUID() == target->GetGUID())
|
||||
visibleFlag |= UF_FLAG_OWNER;
|
||||
|
||||
if (HasFlag(UNIT_DYNAMIC_FLAGS, UNIT_DYNFLAG_SPECIALINFO))
|
||||
if (HasDynamicFlag(UNIT_DYNFLAG_SPECIALINFO))
|
||||
if (ToUnit()->HasAuraTypeWithCaster(SPELL_AURA_EMPATHY, target->GetGUID()))
|
||||
visibleFlag |= UF_FLAG_SPECIAL_INFO;
|
||||
|
||||
|
||||
@@ -105,6 +105,12 @@ public:
|
||||
[[nodiscard]] float GetObjectScale() const { return GetFloatValue(OBJECT_FIELD_SCALE_X); }
|
||||
virtual void SetObjectScale(float scale) { SetFloatValue(OBJECT_FIELD_SCALE_X, scale); }
|
||||
|
||||
virtual uint32 GetDynamicFlags() const { return 0; }
|
||||
bool HasDynamicFlag(uint32 flag) const { return (GetDynamicFlags() & flag) != 0; }
|
||||
virtual void SetDynamicFlag(uint32 flag) { ReplaceAllDynamicFlags(GetDynamicFlags() | flag); }
|
||||
virtual void RemoveDynamicFlag(uint32 flag) { ReplaceAllDynamicFlags(GetDynamicFlags() & ~flag); }
|
||||
virtual void ReplaceAllDynamicFlags([[maybe_unused]] uint32 flag) { }
|
||||
|
||||
[[nodiscard]] TypeID GetTypeId() const { return m_objectTypeId; }
|
||||
[[nodiscard]] bool isType(uint16 mask) const { return (mask & m_objectType); }
|
||||
|
||||
|
||||
Reference in New Issue
Block a user