Core/Auras: Remove auras with AURA_INTERRUPT_FLAG_HITBYSPELL on spell hit, only when target hit is enemy.

This commit is contained in:
QAston
2011-06-21 15:55:23 +02:00
parent a02d145a17
commit fcc02a045a

View File

@@ -1359,14 +1359,16 @@ SpellMissInfo Spell::DoSpellHitOnUnit(Unit *unit, const uint32 effectMask, bool
if (m_spellInfo->speed > 0.0f && unit->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE) && unit->GetCharmerOrOwnerGUID() != m_caster->GetGUID())
return SPELL_MISS_EVADE;
if (!m_caster->IsFriendlyTo(unit))
// check for IsHostileTo() instead of !IsFriendlyTo()
// ex: spell 47463 needs to be casted by different units on the same neutral target
if (m_caster->IsHostileTo(unit))
{
unit->RemoveAurasWithInterruptFlags(AURA_INTERRUPT_FLAG_HITBYSPELL);
//TODO: This is a hack. But we do not know what types of stealth should be interrupted by CC
if ((m_customAttr & SPELL_ATTR0_CU_AURA_CC) && unit->IsControlledByPlayer())
unit->RemoveAurasByType(SPELL_AURA_MOD_STEALTH);
}
else
else if (m_caster->IsFriendlyTo(unit))
{
// for delayed spells ignore negative spells (after duel end) for friendly targets
// TODO: this cause soul transfer bugged