Core/Spells: Righteous Defense shouldn't affect targets that can't attack you

This commit is contained in:
Shocker
2011-06-04 13:18:38 +03:00
parent 665dbfd9ae
commit 599bbad6aa
+7
View File
@@ -1381,6 +1381,13 @@ void Spell::EffectDummy(SpellEffIndex effIndex)
// not empty (checked), copy
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
uint32 maxTargets = std::min<uint32>(3, attackers.size());
for (uint32 i = 0; i < maxTargets; ++i)