diff options
| author | Nay <dnpd.dd@gmail.com> | 2013-02-09 20:33:30 +0000 |
|---|---|---|
| committer | Nay <dnpd.dd@gmail.com> | 2013-02-09 20:33:30 +0000 |
| commit | 984e1feadfae97c7616c54f9ac731cc6db4f2e15 (patch) | |
| tree | b49dba486d5a5d7fe1511089d7616e56464da04c /src/server/game/AI | |
| parent | 943c866da97871d382db2f52e965ed38558695b0 (diff) | |
| parent | 985de41421f33178cffd2247ab14369334e801ee (diff) | |
Merge remote-tracking branch 'origin/master' into 4.3.4
Conflicts:
src/server/game/Server/WorldSocket.cpp
Diffstat (limited to 'src/server/game/AI')
| -rw-r--r-- | src/server/game/AI/CreatureAISelector.cpp | 6 | ||||
| -rw-r--r-- | src/server/game/AI/SmartScripts/SmartAI.cpp | 11 |
2 files changed, 7 insertions, 10 deletions
diff --git a/src/server/game/AI/CreatureAISelector.cpp b/src/server/game/AI/CreatureAISelector.cpp index 920c1c25533..a09feb6e00f 100644 --- a/src/server/game/AI/CreatureAISelector.cpp +++ b/src/server/game/AI/CreatureAISelector.cpp @@ -132,16 +132,12 @@ namespace FactorySelector const GameObjectAICreator* ai_factory = NULL; GameObjectAIRegistry& ai_registry(*GameObjectAIRepository::instance()); + // scriptname in db if (GameObjectAI* scriptedAI = sScriptMgr->GetGameObjectAI(go)) return scriptedAI; ai_factory = ai_registry.GetRegistryItem(go->GetAIName()); - // scriptname in db - if (!ai_factory) - if (GameObjectAI* scriptedAI = sScriptMgr->GetGameObjectAI(go)) - return scriptedAI; - //future goAI types go here std::string ainame = (ai_factory == NULL || go->GetScriptId()) ? "NullGameObjectAI" : ai_factory->key(); diff --git a/src/server/game/AI/SmartScripts/SmartAI.cpp b/src/server/game/AI/SmartScripts/SmartAI.cpp index e568a36abc4..501bc35b77a 100644 --- a/src/server/game/AI/SmartScripts/SmartAI.cpp +++ b/src/server/game/AI/SmartScripts/SmartAI.cpp @@ -430,13 +430,14 @@ 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(); ++iter) + Unit::AuraApplicationMap& appliedAuras = me->GetAppliedAuras(); + for (Unit::AuraApplicationMap::iterator iter = appliedAuras.begin(); iter != appliedAuras.end();) { Aura const* aura = iter->second->GetBase(); - if (!aura->GetSpellInfo()->IsPassive() && !aura->GetSpellInfo()->HasAura(SPELL_AURA_CONTROL_VEHICLE) && aura->GetCaster() != me) - me->RemoveAurasDueToSpell(aura->GetId()); + if (!aura->IsPassive() && !aura->HasEffectType(SPELL_AURA_CONTROL_VEHICLE) && aura->GetCasterGUID() != me->GetGUID()) + me->RemoveAura(iter); + else + ++iter; } } |
