aboutsummaryrefslogtreecommitdiff
path: root/src/server/scripts
diff options
context:
space:
mode:
Diffstat (limited to 'src/server/scripts')
-rw-r--r--src/server/scripts/Kalimdor/TempleOfAhnQiraj/mob_anubisath_sentinel.cpp13
1 files changed, 6 insertions, 7 deletions
diff --git a/src/server/scripts/Kalimdor/TempleOfAhnQiraj/mob_anubisath_sentinel.cpp b/src/server/scripts/Kalimdor/TempleOfAhnQiraj/mob_anubisath_sentinel.cpp
index 87a9b322be3..758111be8a0 100644
--- a/src/server/scripts/Kalimdor/TempleOfAhnQiraj/mob_anubisath_sentinel.cpp
+++ b/src/server/scripts/Kalimdor/TempleOfAhnQiraj/mob_anubisath_sentinel.cpp
@@ -258,13 +258,12 @@ public:
Unit *GetHatedManaUser() const
{
- std::list<HostileReference*>::const_iterator i;
- for (i = me->getThreatManager().getThreatList().begin(); i != me->getThreatManager().getThreatList().end(); ++i)
- {
- Unit* pUnit = Unit::GetUnit((*me), (*i)->getUnitGuid());
- if (pUnit->getPowerType() == POWER_MANA)
- return pUnit;
- }
+ std::list<HostileReference*> const& threatList = me->getThreatManager().getThreatList();
+ for (std::list<HostileReference*>::const_iterator i = threatList.begin(); i != threatList.end(); ++i)
+ if (Unit* unit = (*i)->getTarget())
+ if (unit->getPowerType() == POWER_MANA)
+ return unit;
+
return NULL;
}