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 (https://github.com/TrinityCore/TrinityCore/commit/230f40f359c80b102f344ed55adc12f246a97051)

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:
Kitzunu
2022-05-08 23:10:10 +02:00
committed by GitHub
parent 8f485cb5d4
commit 969cb68c35
2 changed files with 10 additions and 10 deletions
+6 -6
View File
@@ -349,14 +349,14 @@ public:
m_flags = 0; m_flags = 0;
} }
[[nodiscard]] T_FLAGS GetFlags() const { return m_flags; } [[nodiscard]] T_FLAGS GetFlags() const { return m_flags; }
[[nodiscard]] bool HasFlag(FLAG_TYPE flag) const { return m_flags & (1 << flag); } [[nodiscard]] bool HasFlag(FLAG_TYPE flag) const { return m_flags & (1 << flag); }
void AddFlag(FLAG_TYPE flag) { m_flags |= (1 << flag); } void AddFlag(FLAG_TYPE flag) { m_flags |= (1 << flag); }
void DelFlag(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]; } [[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 SetValue(FLAG_TYPE flag, T_VALUES value) { m_values[flag] = value; }
void AddValue(FLAG_TYPE flag, T_VALUES value) { m_values[flag] += value; } void AddValue(FLAG_TYPE flag, T_VALUES value) { m_values[flag] += value; }
private: private:
T_VALUES m_values[ARRAY_SIZE]; T_VALUES m_values[ARRAY_SIZE];
@@ -1537,7 +1537,7 @@ void AuraEffect::HandleModInvisibility(AuraApplication const* aurApp, uint8 mode
if (apply) if (apply)
{ {
// apply glow vision // 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->SetByteFlag(PLAYER_FIELD_BYTES2, PLAYER_FIELD_BYTES_2_OFFSET_AURA_VISION, PLAYER_FIELD_BYTE2_INVISIBILITY_GLOW);
target->m_invisibility.AddFlag(type); target->m_invisibility.AddFlag(type);
@@ -1568,14 +1568,14 @@ void AuraEffect::HandleModInvisibility(AuraApplication const* aurApp, uint8 mode
} }
if (!found) if (!found)
{ {
target->m_invisibility.DelFlag(type);
// if not have invisibility auras of type INVISIBILITY_GENERAL // if not have invisibility auras of type INVISIBILITY_GENERAL
// remove glow vision // 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->RemoveByteFlag(PLAYER_FIELD_BYTES2, PLAYER_FIELD_BYTES_2_OFFSET_AURA_VISION, PLAYER_FIELD_BYTE2_INVISIBILITY_GLOW);
} }
target->m_invisibility.DelFlag(type);
} }
} }