aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMeji <alvaromegias_46@hotmail.com>2021-07-17 18:32:47 +0200
committerShauren <shauren.trinity@gmail.com>2022-03-11 18:45:58 +0100
commit8ee432b1f03352345386201b99be1de19f043404 (patch)
treee9ee1436c75feb8d1c022de070222f0ca03023ee /src
parentc2b8c13a9819d04f1d3ea968c199c9c2d41a16d4 (diff)
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 (cherry picked from commit 47a4d58a982d5c22fbcdd07cac9dae5fd1bc52e4)
Diffstat (limited to 'src')
-rw-r--r--src/server/game/Spells/Auras/SpellAuraEffects.cpp12
1 files changed, 10 insertions, 2 deletions
diff --git a/src/server/game/Spells/Auras/SpellAuraEffects.cpp b/src/server/game/Spells/Auras/SpellAuraEffects.cpp
index 1bdb4c64437..86b6b42f455 100644
--- a/src/server/game/Spells/Auras/SpellAuraEffects.cpp
+++ b/src/server/game/Spells/Auras/SpellAuraEffects.cpp
@@ -1426,12 +1426,13 @@ void AuraEffect::HandleModInvisibility(AuraApplication const* aurApp, uint8 mode
return;
Unit* target = aurApp->GetTarget();
+ Player* playerTarget = target->ToPlayer();
InvisibilityType type = InvisibilityType(GetMiscValue());
if (apply)
{
// apply glow vision
- if (Player* playerTarget = target->ToPlayer())
+ if (playerTarget && type == INVISIBILITY_GENERAL)
playerTarget->AddAuraVision(PLAYER_FIELD_BYTE2_INVISIBILITY_GLOW);
target->m_invisibility.AddFlag(type);
@@ -1442,7 +1443,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 (Player * playerTarget = target->ToPlayer())
playerTarget->RemoveAuraVision(PLAYER_FIELD_BYTE2_INVISIBILITY_GLOW);
@@ -1461,7 +1462,14 @@ void AuraEffect::HandleModInvisibility(AuraApplication const* aurApp, uint8 mode
}
}
if (!found)
+ {
+ // if not have invisibility auras of type INVISIBILITY_GENERAL
+ // remove glow vision
+ if (playerTarget && type == INVISIBILITY_GENERAL)
+ playerTarget->RemoveAuraVision(PLAYER_FIELD_BYTE2_INVISIBILITY_GLOW);
+
target->m_invisibility.DelFlag(type);
+ }
}
target->m_invisibility.AddValue(type, -GetAmount());