From 969cb68c356be78d5b6b72fde3b04f372a8847a4 Mon Sep 17 00:00:00 2001 From: Kitzunu <24550914+Kitzunu@users.noreply.github.com> Date: Sun, 8 May 2022 23:10:10 +0200 Subject: [PATCH] =?UTF-8?q?fix(Core/Auras):=20INVISIBILITY=5FUNK10=20also?= =?UTF-8?q?=20applies=20the=20flag=20PLAYER=5FFIELD=5FBYTE=E2=80=A6=20(#11?= =?UTF-8?q?588)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * 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> --- src/server/game/Entities/Object/Object.h | 12 ++++++------ src/server/game/Spells/Auras/SpellAuraEffects.cpp | 8 ++++---- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/src/server/game/Entities/Object/Object.h b/src/server/game/Entities/Object/Object.h index b36eabc93..306a30db7 100644 --- a/src/server/game/Entities/Object/Object.h +++ b/src/server/game/Entities/Object/Object.h @@ -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]; diff --git a/src/server/game/Spells/Auras/SpellAuraEffects.cpp b/src/server/game/Spells/Auras/SpellAuraEffects.cpp index 1e5187024..4d9e89169 100644 --- a/src/server/game/Spells/Auras/SpellAuraEffects.cpp +++ b/src/server/game/Spells/Auras/SpellAuraEffects.cpp @@ -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); } }