From 603e4a7dc56488ec4702983a8bda6782f35d1eaa Mon Sep 17 00:00:00 2001 From: Charles A Edwards Date: Thu, 21 Jan 2016 13:14:11 +0000 Subject: [PATCH] Moved condition related to mage casting on self Moved condition related to prevention of casting on self. Will check the other cores to see if this needs to be applied to them too. It does need to be applied to One. --- src/game/WorldHandlers/Spell.cpp | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/src/game/WorldHandlers/Spell.cpp b/src/game/WorldHandlers/Spell.cpp index 763e8c0b..c8e51474 100644 --- a/src/game/WorldHandlers/Spell.cpp +++ b/src/game/WorldHandlers/Spell.cpp @@ -4242,6 +4242,11 @@ SpellCastResult Spell::CheckCast(bool strict) { if (m_caster->GetTypeId() == TYPEID_PLAYER && m_caster->IsInWorld()) { + // Arcane Missile self cast forbidden + if (m_spellInfo->SpellFamilyName == SPELLFAMILY_MAGE && + m_spellInfo->SpellFamilyFlags & UI64LIT(0x00000800)) + { return SPELL_FAILED_BAD_TARGETS; } + // Additional check for some spells // If 0 spell effect empty - client not send target data (need use selection) // TODO: check it on next client version @@ -4252,12 +4257,6 @@ SpellCastResult Spell::CheckCast(bool strict) if (!target) { return SPELL_FAILED_BAD_TARGETS; } - // Arcane Missile self cast forbidden - if (m_spellInfo->SpellFamilyName == SPELLFAMILY_MAGE && - m_spellInfo->SpellFamilyFlags & UI64LIT(0x00000800) && - m_caster == target) - { return SPELL_FAILED_BAD_TARGETS; } - m_targets.setUnitTarget(target); } }