aboutsummaryrefslogtreecommitdiff
path: root/src/game/Unit.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/game/Unit.cpp')
-rw-r--r--src/game/Unit.cpp31
1 files changed, 6 insertions, 25 deletions
diff --git a/src/game/Unit.cpp b/src/game/Unit.cpp
index 89f730e2fda..b19c88ba376 100644
--- a/src/game/Unit.cpp
+++ b/src/game/Unit.cpp
@@ -4109,6 +4109,10 @@ void Unit::RemoveAura(AuraMap::iterator &i, AuraRemoveMode mode)
++m_removedAurasCount;
+ if(Aur->IsPersistent())
+ if(DynamicObject *dynObj = ObjectAccessor::GetObjectInWorld(Aur->GetSourceGUID(), (DynamicObject*)NULL))
+ dynObj->RemoveAffected(this);
+
Aur->UnregisterSingleCastAura();
if(Aur->GetSpellProto()->AuraInterruptFlags)
@@ -4428,24 +4432,6 @@ void Unit::RemoveAllDynObjects()
}
}
-DynamicObject * Unit::GetDynObject(uint32 spellId, uint32 effIndex)
-{
- for (DynObjectGUIDs::iterator i = m_dynObjGUIDs.begin(); i != m_dynObjGUIDs.end();)
- {
- DynamicObject* dynObj = GetMap()->GetDynamicObject(*i);
- if(!dynObj)
- {
- i = m_dynObjGUIDs.erase(i);
- continue;
- }
-
- if (dynObj->GetSpellId() == spellId && dynObj->GetEffIndex() == effIndex)
- return dynObj;
- ++i;
- }
- return NULL;
-}
-
DynamicObject * Unit::GetDynObject(uint32 spellId)
{
for (DynObjectGUIDs::iterator i = m_dynObjGUIDs.begin(); i != m_dynObjGUIDs.end();)
@@ -14489,17 +14475,12 @@ void Unit::HandleAuraEffect(AuraEffect * aureff, bool apply)
{
if (!aureff->IsApplied())
return;
+
aureff->SetApplied(false);
// remove from list before mods removing (prevent cyclic calls, mods added before including to aura list - use reverse order)
m_modAuras[aureff->GetAuraName()].remove(aureff);
aureff->ApplyModifier(false, true);
- Unit * caster = aureff->GetParentAura()->GetCaster();
- if(caster && aureff->IsPersistent())
- {
- DynamicObject *dynObj = caster->GetDynObject(aureff->GetId(), aureff->GetEffIndex());
- if (dynObj)
- dynObj->RemoveAffected(this);
- }
+
// Remove all triggered by aura spells vs unlimited duration
aureff->CleanupTriggeredSpells();
}