aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorShauren <none@none>2010-12-20 11:39:12 +0100
committerShauren <none@none>2010-12-20 11:39:12 +0100
commite3e77aceab7f4781f71890110e4a88dcc8e60d44 (patch)
treec23ee8cce51292e441c4279acb154ff7e6b684a6
parent756ee5832ba09923eb0e736fd85f8ba0ae72001e (diff)
Scripts/Temple of Anh'Qiraj: Fixed possible crash in mob_anubisath_sentinel
--HG-- branch : trunk
-rwxr-xr-xsrc/server/game/Entities/Unit/Unit.cpp3
-rw-r--r--src/server/scripts/Kalimdor/TempleOfAhnQiraj/mob_anubisath_sentinel.cpp13
2 files changed, 7 insertions, 9 deletions
diff --git a/src/server/game/Entities/Unit/Unit.cpp b/src/server/game/Entities/Unit/Unit.cpp
index 9f609df1394..a3757827b6d 100755
--- a/src/server/game/Entities/Unit/Unit.cpp
+++ b/src/server/game/Entities/Unit/Unit.cpp
@@ -3435,9 +3435,8 @@ void Unit::_AddAura(UnitAura * aura, Unit * caster)
if (Aura * foundAura = GetOwnedAura(aura->GetId(), aura->GetCasterGUID(), aura->GetCastItemGUID(), 0, aura))
{
if (aura->GetSpellProto()->StackAmount)
- {
aura->ModStackAmount(foundAura->GetStackAmount());
- }
+
// Update periodic timers from the previous aura
for (uint8 i = 0; i < MAX_SPELL_EFFECTS; ++i)
{
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;
}