diff options
-rw-r--r-- | src/server/game/AI/CoreAI/UnitAI.cpp | 6 |
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 0166a3b2880..92c9c8e3fb6 100644 --- a/src/server/game/AI/CoreAI/UnitAI.cpp +++ b/src/server/game/AI/CoreAI/UnitAI.cpp @@ -259,8 +259,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 ? unit->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 ? unit->GetThreatManager().GetCurrentVictim() : nullptr), m_aura(aura) { } @@ -272,7 +272,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)) |