Core/Spells: Righteous Defense shouldn't affect targets that can't attack you
This commit is contained in:
@@ -1381,6 +1381,13 @@ void Spell::EffectDummy(SpellEffIndex effIndex)
|
|||||||
// not empty (checked), copy
|
// not empty (checked), copy
|
||||||
Unit::AttackerSet attackers = unitTarget->getAttackers();
|
Unit::AttackerSet attackers = unitTarget->getAttackers();
|
||||||
|
|
||||||
|
// remove invalid attackers
|
||||||
|
for (Unit::AttackerSet::iterator aItr = attackers.begin(); aItr != attackers.end(); )
|
||||||
|
if (!(*aItr)->canAttack(m_caster))
|
||||||
|
attackers.erase(aItr++);
|
||||||
|
else
|
||||||
|
++aItr;
|
||||||
|
|
||||||
// selected from list 3
|
// selected from list 3
|
||||||
uint32 maxTargets = std::min<uint32>(3, attackers.size());
|
uint32 maxTargets = std::min<uint32>(3, attackers.size());
|
||||||
for (uint32 i = 0; i < maxTargets; ++i)
|
for (uint32 i = 0; i < maxTargets; ++i)
|
||||||
|
|||||||
Reference in New Issue
Block a user