From 47a4d58a982d5c22fbcdd07cac9dae5fd1bc52e4 Mon Sep 17 00:00:00 2001 From: Meji Date: Sat, 17 Jul 2021 18:32:47 +0200 Subject: Core/Spells: PLAYER_FIELD_BYTE2_INVISIBILITY_GLOW applies only with invisibility type INVISIBILITY_GENERAL (0) (#26701) * Core/Spells: PLAYER_FIELD_BYTE2_INVISIBILITY_GLOW applies only with invisibility type INVISIBILITY_GENERAL (0) * Use enum --- src/server/game/Spells/Auras/SpellAuraEffects.cpp | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/server/game/Spells/Auras/SpellAuraEffects.cpp b/src/server/game/Spells/Auras/SpellAuraEffects.cpp index 3dc138b3796..914e2a5f079 100644 --- a/src/server/game/Spells/Auras/SpellAuraEffects.cpp +++ b/src/server/game/Spells/Auras/SpellAuraEffects.cpp @@ -1361,7 +1361,7 @@ void AuraEffect::HandleModInvisibility(AuraApplication const* aurApp, uint8 mode if (apply) { // apply glow vision - if (target->GetTypeId() == TYPEID_PLAYER) + if (target->GetTypeId() == TYPEID_PLAYER && type == INVISIBILITY_GENERAL) target->SetByteFlag(PLAYER_FIELD_BYTES2, PLAYER_FIELD_BYTES_2_OFFSET_AURA_VISION, PLAYER_FIELD_BYTE2_INVISIBILITY_GLOW); target->m_invisibility.AddFlag(type); @@ -1372,7 +1372,7 @@ void AuraEffect::HandleModInvisibility(AuraApplication const* aurApp, uint8 mode if (!target->HasAuraType(SPELL_AURA_MOD_INVISIBILITY)) { // if not have different invisibility auras. - // remove glow vision + // always remove glow vision if (target->GetTypeId() == TYPEID_PLAYER) target->RemoveByteFlag(PLAYER_FIELD_BYTES2, PLAYER_FIELD_BYTES_2_OFFSET_AURA_VISION, PLAYER_FIELD_BYTE2_INVISIBILITY_GLOW); @@ -1391,7 +1391,14 @@ void AuraEffect::HandleModInvisibility(AuraApplication const* aurApp, uint8 mode } } if (!found) + { + // if not have invisibility auras of type INVISIBILITY_GENERAL + // remove glow vision + if (target->GetTypeId() == TYPEID_PLAYER && type == INVISIBILITY_GENERAL) + target->RemoveByteFlag(PLAYER_FIELD_BYTES2, PLAYER_FIELD_BYTES_2_OFFSET_AURA_VISION, PLAYER_FIELD_BYTE2_INVISIBILITY_GLOW); + target->m_invisibility.DelFlag(type); + } } target->m_invisibility.AddValue(type, -GetAmount()); -- cgit v1.2.3