From dbcca634e807e7a807d8e8909e44fc126e05f4a4 Mon Sep 17 00:00:00 2001 From: Schmoozerd Date: Sat, 16 Apr 2011 10:46:08 +0300 Subject: [PATCH] [11366] Fix wrong faction-based targeting of DynamicObject's auras --- src/game/SpellEffects.cpp | 8 +++++--- src/shared/revision_nr.h | 2 +- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/src/game/SpellEffects.cpp b/src/game/SpellEffects.cpp index 41e71ca1d..9f1474751 100644 --- a/src/game/SpellEffects.cpp +++ b/src/game/SpellEffects.cpp @@ -4004,15 +4004,17 @@ void Spell::EffectPersistentAA(SpellEffectIndex eff_idx) if (Player* modOwner = m_caster->GetSpellModOwner()) modOwner->ApplySpellMod(m_spellInfo->Id, SPELLMOD_RADIUS, radius); + Unit* pCaster = GetAffectiveCaster() ? GetAffectiveCaster() : m_caster; + DynamicObject* dynObj = new DynamicObject; - if (!dynObj->Create(m_caster->GetMap()->GenerateLocalLowGuid(HIGHGUID_DYNAMICOBJECT), m_caster, m_spellInfo->Id, eff_idx, m_targets.m_destX, m_targets.m_destY, m_targets.m_destZ, m_duration, radius)) + if (!dynObj->Create(pCaster->GetMap()->GenerateLocalLowGuid(HIGHGUID_DYNAMICOBJECT), pCaster, m_spellInfo->Id, eff_idx, m_targets.m_destX, m_targets.m_destY, m_targets.m_destZ, m_duration, radius)) { delete dynObj; return; } - m_caster->AddDynObject(dynObj); - m_caster->GetMap()->Add(dynObj); + pCaster->AddDynObject(dynObj); + pCaster->GetMap()->Add(dynObj); } void Spell::EffectEnergize(SpellEffectIndex eff_idx) diff --git a/src/shared/revision_nr.h b/src/shared/revision_nr.h index 8ccf6bc71..133569335 100644 --- a/src/shared/revision_nr.h +++ b/src/shared/revision_nr.h @@ -1,4 +1,4 @@ #ifndef __REVISION_NR_H__ #define __REVISION_NR_H__ - #define REVISION_NR "11365" + #define REVISION_NR "11366" #endif // __REVISION_NR_H__