diff options
author | treeston <treeston.mmoc@gmail.com> | 2017-07-09 02:53:00 +0200 |
---|---|---|
committer | Shauren <shauren.trinity@gmail.com> | 2020-08-18 18:53:13 +0200 |
commit | 1e6480ee358977cdb6596a0dba8b2a1c4ef04a0b (patch) | |
tree | 31c4c031752d1f680e02fbfdb0af61337ce7c880 | |
parent | 2dfafa69ebc422feba1aa01e0c4fab76366f552f (diff) |
Woopsie. Fix an oversight causing the main tank flag in SelectTarget to be inverted.
(cherry picked from commit 9bacaf15b60dc455ae913062b05a5adb2b8bdcf9)
-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 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)) |