[11373] Clarify Spell::GetAffectiveCaster result and add comment for recent added call case.

This commit is contained in:
VladimirMangos 2011-04-17 03:54:37 +04:00
parent 7b2308e483
commit 5fae870a1d
3 changed files with 6 additions and 3 deletions

View file

@ -4004,7 +4004,10 @@ 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;
Unit* pCaster = GetAffectiveCaster();
// FIXME: in case wild GO will used wrong affective caster (target in fact) as dynobject owner
if (!pCaster)
pCaster = m_caster;
DynamicObject* dynObj = new DynamicObject;
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))