Core/Spells: Don't fail spells SPELL_ATTR2_FAIL_ON_ALL_TARGETS_IMMUNE when target list is empty for one effect
Port From (https://github.com/TrinityCore/TrinityCore/commit/a5c547a383e40b155a2063404c040ea0007c9ebd)
This commit is contained in:
+12
-11
@@ -275,17 +275,6 @@ namespace Game.Spells
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (m_spellInfo.HasAttribute(SpellAttr2.FailOnAllTargetsImmune))
|
|
||||||
{
|
|
||||||
bool anyNonImmuneTargetFound = m_UniqueTargetInfo.Any(target => (target.EffectMask & 1 << (int)spellEffectInfo.EffectIndex) != 0 && target.MissCondition != SpellMissInfo.Immune && target.MissCondition != SpellMissInfo.Immune2);
|
|
||||||
|
|
||||||
if (!anyNonImmuneTargetFound)
|
|
||||||
{
|
|
||||||
SendCastResult(SpellCastResult.Immune);
|
|
||||||
Finish(SpellCastResult.Immune);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (m_spellInfo.IsChanneled())
|
if (m_spellInfo.IsChanneled())
|
||||||
@@ -310,6 +299,18 @@ namespace Game.Spells
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (m_spellInfo.HasAttribute(SpellAttr2.FailOnAllTargetsImmune))
|
||||||
|
{
|
||||||
|
bool anyNonImmuneTargetFound = m_UniqueTargetInfo.Any(target => target.MissCondition != SpellMissInfo.Immune && target.MissCondition != SpellMissInfo.Immune2);
|
||||||
|
|
||||||
|
if (!anyNonImmuneTargetFound)
|
||||||
|
{
|
||||||
|
SendCastResult(SpellCastResult.Immune);
|
||||||
|
Finish(SpellCastResult.Immune);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (m_targets.HasDst())
|
if (m_targets.HasDst())
|
||||||
{
|
{
|
||||||
if (m_spellInfo.HasAttribute(SpellAttr8.RequiresLocationToBeOnLiquidSurface))
|
if (m_spellInfo.HasAttribute(SpellAttr8.RequiresLocationToBeOnLiquidSurface))
|
||||||
|
|||||||
Reference in New Issue
Block a user