From 9bacaf15b60dc455ae913062b05a5adb2b8bdcf9 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. --- 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 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 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)) -- cgit v1.2.3