[6988] Recheck UNIT_FLAG_NON_ATTACKABLE for delayed spells

Signed-off-by: DiSlord <dislord@nomail.com>
This commit is contained in:
megamage 2008-12-31 00:24:28 +03:00
parent 9a411858d0
commit 61063ad94c
2 changed files with 10 additions and 1 deletions

View file

@ -1067,6 +1067,15 @@ void Spell::DoSpellHitOnUnit(Unit *unit, const uint32 effectMask)
if( m_caster != unit )
{
// Recheck UNIT_FLAG_NON_ATTACKABLE for delayed spells
if (m_spellInfo->speed > 0.0f &&
unit->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE) &&
unit->GetCharmerOrOwnerGUID() != m_caster->GetGUID())
{
m_caster->SendSpellMiss(unit, m_spellInfo->Id, SPELL_MISS_EVADE);
return;
}
if( !m_caster->IsFriendlyTo(unit) )
{
// for delayed spells ignore not visible explicit target