aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorariel- <ariel-@users.noreply.github.com>2016-11-14 15:22:41 -0300
committerariel- <ariel-@users.noreply.github.com>2016-11-14 15:22:41 -0300
commit425f6c3c34b72190e481ba89fd4757df238475d8 (patch)
tree3e85829af482597137ecea7876e9f3f1b74f58b3 /src
parent1ad9c7d3fd4e7cfb2a6b12fc37bd748cf5fd772b (diff)
Core/Spell: perform charmer check against player controlling unit. Fixes spellcasts while charmed
Diffstat (limited to 'src')
-rw-r--r--src/server/game/Spells/Spell.cpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/server/game/Spells/Spell.cpp b/src/server/game/Spells/Spell.cpp
index 54e04c087d2..a0bd3306423 100644
--- a/src/server/game/Spells/Spell.cpp
+++ b/src/server/game/Spells/Spell.cpp
@@ -5768,8 +5768,12 @@ SpellCastResult Spell::CheckCasterAuras(uint32* param1) const
// Get unit state
uint32 const unitflag = m_caster->GetUInt32Value(UNIT_FIELD_FLAGS);
- if (m_caster->GetCharmerGUID() && CheckCasterNotImmunedCharmAuras(param1))
- result = SPELL_FAILED_CHARMED;
+ if (m_caster->GetCharmerGUID())
+ {
+ if (Unit* charmer = m_caster->GetCharmer())
+ if (charmer->GetUnitBeingMoved() != m_caster && CheckCasterNotImmunedCharmAuras(param1))
+ result = SPELL_FAILED_CHARMED;
+ }
else if (unitflag & UNIT_FLAG_STUNNED && !usableWhileStunned && CheckCasterNotImmunedStunAuras(param1))
result = SPELL_FAILED_STUNNED;
else if (unitflag & UNIT_FLAG_SILENCED && m_spellInfo->PreventionType == SPELL_PREVENTION_TYPE_SILENCE && CheckCasterNotImmunedSilenceAuras(param1))