*Fix the bug that player's pet enterevademode repeatedly.

--HG--
branch : trunk
This commit is contained in:
megamage
2009-08-06 14:39:06 -05:00
parent 624bd6a1f0
commit 91885a7790
+10 -11
View File
@@ -11533,7 +11533,7 @@ Unit* Creature::SelectVictim()
// No taunt aura or taunt aura caster is dead standart target selection // No taunt aura or taunt aura caster is dead standart target selection
target = m_ThreatManager.getHostilTarget(); target = m_ThreatManager.getHostilTarget();
} }
else else if(!HasReactState(REACT_PASSIVE))
{ {
// We have player pet probably // We have player pet probably
target = getAttackerForHelper(); target = getAttackerForHelper();
@@ -11541,25 +11541,24 @@ Unit* Creature::SelectVictim()
{ {
if (Unit * owner = ((TempSummon*)this)->GetOwner()) if (Unit * owner = ((TempSummon*)this)->GetOwner())
{ {
if (HasReactState(REACT_AGGRESSIVE) || HasReactState(REACT_DEFENSIVE)) if (owner->isInCombat())
target = owner->getAttackerForHelper();
if (!target)
{ {
if (owner->isInCombat()) for(ControlList::const_iterator itr = owner->m_Controlled.begin(); itr != owner->m_Controlled.end(); ++itr)
target = owner->getAttackerForHelper();
if (!target)
{ {
for(ControlList::const_iterator itr = owner->m_Controlled.begin(); itr != owner->m_Controlled.end(); ++itr) if ((*itr)->isInCombat())
{ {
if ((*itr)->isInCombat()) target = (*itr)->getAttackerForHelper();
{ if (target) break;
target = (*itr)->getAttackerForHelper();
if (target) break;
}
} }
} }
} }
} }
} }
} }
else
return NULL;
if(target) if(target)
{ {