aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorariel- <ariel-@users.noreply.github.com>2016-11-13 19:09:48 -0300
committerariel- <ariel-@users.noreply.github.com>2016-11-14 02:06:33 -0300
commitfd3423245cea6f3b6f4aa98edf598b7c367bad95 (patch)
treedb1929cfef85128b0b21c7865cc03fcb2ba23cac
parentfc6844173f70f436b92fb0dbc4398290ce935038 (diff)
Core/Spell: use SpellEntry to select implicit targets in case RadiusEntry wasn't set for the current effect.
Closes #15388
-rw-r--r--src/server/game/Spells/Spell.cpp18
1 files changed, 15 insertions, 3 deletions
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<WorldObject*> 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);