mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-20 01:15:35 +01:00
Core/Auras: Remove auras with AURA_INTERRUPT_FLAG_HITBYSPELL on spell hit, only when target hit is enemy.
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user