Core/Auras: Prevent assertion fail due code in AuraEffect::HandleAuraLinked, also improve the sync between auras linked by this aura type.

This commit is contained in:
QAston
2011-05-29 15:49:32 +02:00
parent ab15d2526f
commit 3c93cccdb1
3 changed files with 37 additions and 16 deletions
+9 -2
View File
@@ -427,7 +427,7 @@ uint32 CalculatePowerCost(SpellEntry const * spellInfo, Unit const * caster, Spe
return powerCost;
}
Unit* GetTriggeredSpellCaster(SpellEntry const * spellInfo, Unit * caster, Unit * target)
bool IsSpellRequiringFocusedTarget(SpellEntry const * spellInfo)
{
for (uint8 i = 0 ; i < MAX_SPELL_EFFECTS; ++i)
{
@@ -437,8 +437,15 @@ Unit* GetTriggeredSpellCaster(SpellEntry const * spellInfo, Unit * caster, Unit
|| SpellTargetType[spellInfo->EffectImplicitTargetB[i]] == TARGET_TYPE_CHANNEL
|| SpellTargetType[spellInfo->EffectImplicitTargetA[i]] == TARGET_TYPE_DEST_TARGET
|| SpellTargetType[spellInfo->EffectImplicitTargetB[i]] == TARGET_TYPE_DEST_TARGET)
return caster;
return true;
}
}
Unit* GetTriggeredSpellCaster(SpellEntry const * spellInfo, Unit * caster, Unit * target)
{
if (IsSpellRequiringFocusedTarget(spellInfo))
return caster;
return target;
}