From 1e6480ee358977cdb6596a0dba8b2a1c4ef04a0b Mon Sep 17 00:00:00 2001 From: treeston Date: Sun, 9 Jul 2017 02:53:00 +0200 Subject: Woopsie. Fix an oversight causing the main tank flag in SelectTarget to be inverted. (cherry picked from commit 9bacaf15b60dc455ae913062b05a5adb2b8bdcf9) --- src/server/game/AI/CoreAI/UnitAI.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src') 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 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)) -- cgit v1.2.3