aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorjoschiwald <joschiwald.trinity@gmail.com>2017-12-10 10:30:21 +0100
committerAokromes <aokromes@gmail.com>2017-12-10 11:16:43 +0100
commit842a65ac15443ea464d85b25afb5ffd6742b1f62 (patch)
tree4dfe9cdd18ba7ac9637f5bf5468565150aac1af3 /src
parent289e5910658e0f0d3928354336640941266fbb2e (diff)
Core/Spells: Spells with TARGET_SELECT_CATEGORY_NEARBY requires a valid target (#20954)
Diffstat (limited to 'src')
-rw-r--r--src/server/game/Spells/Spell.cpp18
1 files changed, 18 insertions, 0 deletions
diff --git a/src/server/game/Spells/Spell.cpp b/src/server/game/Spells/Spell.cpp
index 46f44c16744..715173c3ea6 100644
--- a/src/server/game/Spells/Spell.cpp
+++ b/src/server/game/Spells/Spell.cpp
@@ -1080,6 +1080,11 @@ void Spell::SelectImplicitNearbyTargets(SpellEffIndex effIndex, SpellImplicitTar
{
if (focusObject)
AddGOTarget(focusObject, effMask);
+ else
+ {
+ SendCastResult(SPELL_FAILED_BAD_IMPLICIT_TARGETS);
+ finish(false);
+ }
return;
}
break;
@@ -1092,6 +1097,11 @@ void Spell::SelectImplicitNearbyTargets(SpellEffIndex effIndex, SpellImplicitTar
CallScriptDestinationTargetSelectHandlers(dest, effIndex, targetType);
m_targets.SetDst(dest);
}
+ else
+ {
+ SendCastResult(SPELL_FAILED_BAD_IMPLICIT_TARGETS);
+ finish(false);
+ }
return;
}
break;
@@ -1104,6 +1114,8 @@ void Spell::SelectImplicitNearbyTargets(SpellEffIndex effIndex, SpellImplicitTar
if (!target)
{
TC_LOG_DEBUG("spells", "Spell::SelectImplicitNearbyTargets: cannot find nearby target for spell ID %u, effect %u", m_spellInfo->Id, effIndex);
+ SendCastResult(SPELL_FAILED_BAD_IMPLICIT_TARGETS);
+ finish(false);
return;
}
@@ -1111,6 +1123,8 @@ void Spell::SelectImplicitNearbyTargets(SpellEffIndex effIndex, SpellImplicitTar
if (!target)
{
TC_LOG_DEBUG("spells", "Spell::SelectImplicitNearbyTargets: OnObjectTargetSelect script hook for spell Id %u set NULL target, effect %u", m_spellInfo->Id, effIndex);
+ SendCastResult(SPELL_FAILED_BAD_IMPLICIT_TARGETS);
+ finish(false);
return;
}
@@ -1122,6 +1136,8 @@ void Spell::SelectImplicitNearbyTargets(SpellEffIndex effIndex, SpellImplicitTar
else
{
TC_LOG_DEBUG("spells", "Spell::SelectImplicitNearbyTargets: OnObjectTargetSelect script hook for spell Id %u set object of wrong type, expected unit, got %s, effect %u", m_spellInfo->Id, target->GetGUID().GetTypeName(), effMask);
+ SendCastResult(SPELL_FAILED_BAD_IMPLICIT_TARGETS);
+ finish(false);
return;
}
break;
@@ -1131,6 +1147,8 @@ void Spell::SelectImplicitNearbyTargets(SpellEffIndex effIndex, SpellImplicitTar
else
{
TC_LOG_DEBUG("spells", "Spell::SelectImplicitNearbyTargets: OnObjectTargetSelect script hook for spell Id %u set object of wrong type, expected gameobject, got %s, effect %u", m_spellInfo->Id, target->GetGUID().GetTypeName(), effMask);
+ SendCastResult(SPELL_FAILED_BAD_IMPLICIT_TARGETS);
+ finish(false);
return;
}
break;