aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authormegamage <none@none>2009-08-06 14:39:06 -0500
committermegamage <none@none>2009-08-06 14:39:06 -0500
commit91885a77903666d9c14856972e2f2dded5dea3f3 (patch)
treee7171a0ce431e47dbf677fce09ef49dcc63568a6 /src
parent624bd6a1f08dbf312c045fd46be3d989ddf71f05 (diff)
*Fix the bug that player's pet enterevademode repeatedly.
--HG-- branch : trunk
Diffstat (limited to 'src')
-rw-r--r--src/game/Unit.cpp21
1 files changed, 10 insertions, 11 deletions
diff --git a/src/game/Unit.cpp b/src/game/Unit.cpp
index 794a3e7bcd0..961fb623b72 100644
--- a/src/game/Unit.cpp
+++ b/src/game/Unit.cpp
@@ -11533,7 +11533,7 @@ Unit* Creature::SelectVictim()
// No taunt aura or taunt aura caster is dead standart target selection
target = m_ThreatManager.getHostilTarget();
}
- else
+ else if(!HasReactState(REACT_PASSIVE))
{
// We have player pet probably
target = getAttackerForHelper();
@@ -11541,25 +11541,24 @@ Unit* Creature::SelectVictim()
{
if (Unit * owner = ((TempSummon*)this)->GetOwner())
{
- if (HasReactState(REACT_AGGRESSIVE) || HasReactState(REACT_DEFENSIVE))
+ if (owner->isInCombat())
+ target = owner->getAttackerForHelper();
+ if (!target)
{
- if (owner->isInCombat())
- target = owner->getAttackerForHelper();
- if (!target)
+ for(ControlList::const_iterator itr = owner->m_Controlled.begin(); itr != owner->m_Controlled.end(); ++itr)
{
- 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)
{