From 6ea79fd6916e4c556d42fd646c7967dae99e49fd Mon Sep 17 00:00:00 2001 From: Shauren Date: Sat, 1 Jul 2017 20:40:07 +0200 Subject: [PATCH] Nopch fix --- src/server/game/AI/CoreAI/UnitAI.cpp | 5 +++++ src/server/game/AI/CoreAI/UnitAI.h | 3 +-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/server/game/AI/CoreAI/UnitAI.cpp b/src/server/game/AI/CoreAI/UnitAI.cpp index d210abea53a..01fb094c4f2 100644 --- a/src/server/game/AI/CoreAI/UnitAI.cpp +++ b/src/server/game/AI/CoreAI/UnitAI.cpp @@ -258,6 +258,11 @@ 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) +{ +} + bool DefaultTargetSelector::operator()(Unit const* target) const { if (!me) diff --git a/src/server/game/AI/CoreAI/UnitAI.h b/src/server/game/AI/CoreAI/UnitAI.h index 7dd04d45536..5894677ebdd 100644 --- a/src/server/game/AI/CoreAI/UnitAI.h +++ b/src/server/game/AI/CoreAI/UnitAI.h @@ -66,8 +66,7 @@ struct TC_GAME_API DefaultTargetSelector // playerOnly: self explaining // withMainTank: allow current tank to be selected // aura: if 0: ignored, if > 0: the target shall have the aura, if < 0, the target shall NOT have the aura - 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(Unit const* unit, float dist, bool playerOnly, bool withMainTank, int32 aura); bool operator()(Unit const* target) const; };