mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-01-13 09:17:18 +00:00
fix(Core/Auras): INVISIBILITY_UNK10 also applies the flag PLAYER_FIELD_BYTE… (#11588)
* ore/Auras: INVISIBILITY_UNK10 also applies the flag PLAYER_FIELD_BYTE2_INVISIBILITY_GLOW
* cherry-pick commit (230f40f359)
Co-Authored-By: Meji <2695278+meji46@users.noreply.github.com>
* Update Object.h
* Update Object.h
Co-authored-by: Meji <2695278+meji46@users.noreply.github.com>
This commit is contained in:
@@ -349,14 +349,14 @@ public:
|
||||
m_flags = 0;
|
||||
}
|
||||
|
||||
[[nodiscard]] T_FLAGS GetFlags() const { return m_flags; }
|
||||
[[nodiscard]] bool HasFlag(FLAG_TYPE flag) const { return m_flags & (1 << flag); }
|
||||
void AddFlag(FLAG_TYPE flag) { m_flags |= (1 << flag); }
|
||||
void DelFlag(FLAG_TYPE flag) { m_flags &= ~(1 << flag); }
|
||||
[[nodiscard]] T_FLAGS GetFlags() const { return m_flags; }
|
||||
[[nodiscard]] bool HasFlag(FLAG_TYPE flag) const { return m_flags & (1 << flag); }
|
||||
void AddFlag(FLAG_TYPE flag) { m_flags |= (1 << flag); }
|
||||
void DelFlag(FLAG_TYPE flag) { m_flags &= ~(1 << flag); }
|
||||
|
||||
[[nodiscard]] T_VALUES GetValue(FLAG_TYPE flag) const { return m_values[flag]; }
|
||||
void SetValue(FLAG_TYPE flag, T_VALUES value) { m_values[flag] = value; }
|
||||
void AddValue(FLAG_TYPE flag, T_VALUES value) { m_values[flag] += value; }
|
||||
void SetValue(FLAG_TYPE flag, T_VALUES value) { m_values[flag] = value; }
|
||||
void AddValue(FLAG_TYPE flag, T_VALUES value) { m_values[flag] += value; }
|
||||
|
||||
private:
|
||||
T_VALUES m_values[ARRAY_SIZE];
|
||||
|
||||
@@ -1537,7 +1537,7 @@ void AuraEffect::HandleModInvisibility(AuraApplication const* aurApp, uint8 mode
|
||||
if (apply)
|
||||
{
|
||||
// apply glow vision
|
||||
if (target->GetTypeId() == TYPEID_PLAYER && type == INVISIBILITY_GENERAL)
|
||||
if (target->GetTypeId() == TYPEID_PLAYER && (type == INVISIBILITY_GENERAL || type == INVISIBILITY_UNK10))
|
||||
target->SetByteFlag(PLAYER_FIELD_BYTES2, PLAYER_FIELD_BYTES_2_OFFSET_AURA_VISION, PLAYER_FIELD_BYTE2_INVISIBILITY_GLOW);
|
||||
|
||||
target->m_invisibility.AddFlag(type);
|
||||
@@ -1568,14 +1568,14 @@ void AuraEffect::HandleModInvisibility(AuraApplication const* aurApp, uint8 mode
|
||||
}
|
||||
if (!found)
|
||||
{
|
||||
target->m_invisibility.DelFlag(type);
|
||||
|
||||
// if not have invisibility auras of type INVISIBILITY_GENERAL
|
||||
// remove glow vision
|
||||
if (target->GetTypeId() == TYPEID_PLAYER && type == INVISIBILITY_GENERAL)
|
||||
if (target->GetTypeId() == TYPEID_PLAYER && !target->m_invisibility.HasFlag(INVISIBILITY_GENERAL) && !target->m_invisibility.HasFlag(INVISIBILITY_UNK10))
|
||||
{
|
||||
target->RemoveByteFlag(PLAYER_FIELD_BYTES2, PLAYER_FIELD_BYTES_2_OFFSET_AURA_VISION, PLAYER_FIELD_BYTE2_INVISIBILITY_GLOW);
|
||||
}
|
||||
|
||||
target->m_invisibility.DelFlag(type);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user