diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/server/game/AI/SmartScripts/SmartAI.cpp | 19 | ||||
-rw-r--r-- | src/server/game/AI/SmartScripts/SmartScript.cpp | 18 | ||||
-rw-r--r-- | src/server/game/AI/SmartScripts/SmartScript.h | 1 | ||||
-rw-r--r-- | src/server/game/AI/SmartScripts/SmartScriptMgr.h | 1 |
4 files changed, 4 insertions, 35 deletions
diff --git a/src/server/game/AI/SmartScripts/SmartAI.cpp b/src/server/game/AI/SmartScripts/SmartAI.cpp index b5fdf38a4b6..09d70204a7b 100644 --- a/src/server/game/AI/SmartScripts/SmartAI.cpp +++ b/src/server/game/AI/SmartScripts/SmartAI.cpp @@ -433,24 +433,13 @@ void SmartAI::MovementInform(uint32 MovementType, uint32 Data) void SmartAI::RemoveAuras() { + // Only loop throught the applied auras, because here is where all auras on the current unit are stored Unit::AuraApplicationMap appliedAuras = me->GetAppliedAuras(); - for (Unit::AuraApplicationMap::iterator iter = appliedAuras.begin(); iter != appliedAuras.end();) + for (Unit::AuraApplicationMap::iterator iter = appliedAuras.begin(); iter != appliedAuras.end(); ++iter) { Aura const* aura = iter->second->GetBase(); - if (!aura->GetSpellInfo()->HasAura(SPELL_AURA_CONTROL_VEHICLE) && !(iter->second->GetTarget() == me && aura->GetCaster() == me)) - me->_UnapplyAura(iter, AURA_REMOVE_BY_DEFAULT); - else - ++iter; - } - - Unit::AuraMap ownedAuras = me->GetOwnedAuras(); - for (Unit::AuraMap::iterator iter = ownedAuras.begin(); iter != ownedAuras.end();) - { - Aura* aura = iter->second; - if (!aura->GetSpellInfo()->HasAura(SPELL_AURA_CONTROL_VEHICLE)) - me->RemoveOwnedAura(iter, AURA_REMOVE_BY_DEFAULT); - else - ++iter; + if (!aura->GetSpellInfo()->IsPassive() && !aura->GetSpellInfo()->HasAura(SPELL_AURA_CONTROL_VEHICLE) && aura->GetCaster() != me) + me->RemoveAurasDueToSpell(aura->GetId()); } } diff --git a/src/server/game/AI/SmartScripts/SmartScript.cpp b/src/server/game/AI/SmartScripts/SmartScript.cpp index a2e70e9cbf2..d0c62f8092d 100644 --- a/src/server/game/AI/SmartScripts/SmartScript.cpp +++ b/src/server/game/AI/SmartScripts/SmartScript.cpp @@ -51,7 +51,6 @@ SmartScript::SmartScript() mTemplate = SMARTAI_TEMPLATE_BASIC; meOrigGUID = 0; goOrigGUID = 0; - mResumeActionList = true; mLastInvoker = 0; } @@ -78,22 +77,6 @@ void SmartScript::OnReset() void SmartScript::ProcessEventsFor(SMART_EVENT e, Unit* unit, uint32 var0, uint32 var1, bool bvar, const SpellInfo* spell, GameObject* gob) { - if (e == SMART_EVENT_AGGRO) - { - if (!mResumeActionList) - mTimedActionList.clear();//clear action list if it is not resumable - else - { - for (SmartAIEventList::iterator itr = mTimedActionList.begin(); itr != mTimedActionList.end(); ++itr) - { - if (itr->enableTimed) - { - InitTimer((*itr));//re-init the currently enabled timer, so it restarts the timer when resumed - break; - } - } - } - } for (SmartAIEventList::iterator i = mEvents.begin(); i != mEvents.end(); ++i) { SMART_EVENT eventType = SMART_EVENT((*i).GetEventType()); @@ -3017,7 +3000,6 @@ void SmartScript::SetScript9(SmartScriptHolder& e, uint32 entry) i->event.type = SMART_EVENT_UPDATE_IC; else if (e.action.timedActionList.timerType > 1) i->event.type = SMART_EVENT_UPDATE; - mResumeActionList = e.action.timedActionList.dontResume ? false : true; InitTimer((*i)); } } diff --git a/src/server/game/AI/SmartScripts/SmartScript.h b/src/server/game/AI/SmartScripts/SmartScript.h index 0193ac2bfb6..f55d91ed52f 100644 --- a/src/server/game/AI/SmartScripts/SmartScript.h +++ b/src/server/game/AI/SmartScripts/SmartScript.h @@ -228,7 +228,6 @@ class SmartScript SmartAIEventList mEvents; SmartAIEventList mInstallEvents; SmartAIEventList mTimedActionList; - bool mResumeActionList; Creature* me; uint64 meOrigGUID; GameObject* go; diff --git a/src/server/game/AI/SmartScripts/SmartScriptMgr.h b/src/server/game/AI/SmartScripts/SmartScriptMgr.h index ec4355111b9..7cf290affe3 100644 --- a/src/server/game/AI/SmartScripts/SmartScriptMgr.h +++ b/src/server/game/AI/SmartScripts/SmartScriptMgr.h @@ -824,7 +824,6 @@ struct SmartAction struct { uint32 id; - uint32 dontResume; uint32 timerType; } timedActionList; |