From fd3423245cea6f3b6f4aa98edf598b7c367bad95 Mon Sep 17 00:00:00 2001 From: ariel- Date: Sun, 13 Nov 2016 19:09:48 -0300 Subject: Core/Spell: use SpellEntry to select implicit targets in case RadiusEntry wasn't set for the current effect. Closes #15388 --- src/server/game/Spells/Spell.cpp | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/server/game/Spells/Spell.cpp b/src/server/game/Spells/Spell.cpp index 289c37077ab..ca1a96437b6 100644 --- a/src/server/game/Spells/Spell.cpp +++ b/src/server/game/Spells/Spell.cpp @@ -1118,8 +1118,14 @@ void Spell::SelectImplicitConeTargets(SpellEffIndex effIndex, SpellImplicitTarge SpellTargetObjectTypes objectType = targetType.GetObjectType(); SpellTargetCheckTypes selectionType = targetType.GetCheckType(); ConditionContainer* condList = m_spellInfo->Effects[effIndex].ImplicitTargetConditions; - float coneAngle = float(M_PI) / 2; - float radius = m_spellInfo->Effects[effIndex].CalcRadius(m_caster) * m_spellValue->RadiusMod; + float coneAngle = float(M_PI) / 2.f; + + float radius = m_spellInfo->Effects[effIndex].CalcRadius(m_caster); + // Workaround for some spells that don't have RadiusEntry set in dbc (but SpellRange instead) + if (G3D::fuzzyEq(radius, 0.f)) + radius = m_spellInfo->GetMaxRange(m_spellInfo->IsPositiveEffect(effIndex), m_caster, this); + + radius *= m_spellValue->RadiusMod; if (uint32 containerTypeMask = GetSearcherTypeMask(objectType, condList)) { @@ -1205,7 +1211,13 @@ void Spell::SelectImplicitAreaTargets(SpellEffIndex effIndex, SpellImplicitTarge return; } std::list targets; - float radius = m_spellInfo->Effects[effIndex].CalcRadius(m_caster) * m_spellValue->RadiusMod; + float radius = m_spellInfo->Effects[effIndex].CalcRadius(m_caster); + // Workaround for some spells that don't have RadiusEntry set in dbc (but SpellRange instead) + if (G3D::fuzzyEq(radius, 0.f)) + radius = m_spellInfo->GetMaxRange(m_spellInfo->IsPositiveEffect(effIndex), m_caster, this); + + radius *= m_spellValue->RadiusMod; + SearchAreaTargets(targets, radius, center, referer, targetType.GetObjectType(), targetType.GetCheckType(), m_spellInfo->Effects[effIndex].ImplicitTargetConditions); CallScriptObjectAreaTargetSelectHandlers(targets, effIndex, targetType); -- cgit v1.2.3