aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/server/game/AI/CoreAI/UnitAI.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/server/game/AI/CoreAI/UnitAI.cpp b/src/server/game/AI/CoreAI/UnitAI.cpp
index 149ab1bef2e..55c4f780285 100644
--- a/src/server/game/AI/CoreAI/UnitAI.cpp
+++ b/src/server/game/AI/CoreAI/UnitAI.cpp
@@ -327,8 +327,8 @@ void UnitAI::SortByDistance(std::list<Unit*> list, bool ascending)
list.sort(Trinity::ObjectDistanceOrderPred(me, ascending));
}
-DefaultTargetSelector::DefaultTargetSelector(Unit const* unit, float dist, bool playerOnly, bool withMainTank, int32 aura)
- : me(unit), m_dist(dist), m_playerOnly(playerOnly), except(withMainTank ? me->GetThreatManager().GetCurrentVictim() : nullptr), m_aura(aura)
+DefaultTargetSelector::DefaultTargetSelector(Unit const* unit, float dist, bool playerOnly, bool withTank, int32 aura)
+ : me(unit), m_dist(dist), m_playerOnly(playerOnly), except(!withTank ? me->GetThreatManager().GetCurrentVictim() : nullptr), m_aura(aura)
{
}
@@ -340,7 +340,7 @@ bool DefaultTargetSelector::operator()(Unit const* target) const
if (!target)
return false;
- if (target == except)
+ if (except && target == except)
return false;
if (m_playerOnly && (target->GetTypeId() != TYPEID_PLAYER))