diff options
author | joschiwald <joschiwald.trinity@gmail.com> | 2017-12-10 10:30:21 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-12-10 10:30:21 +0100 |
commit | b7797607e0ba9c343b6a58b18627ba53ef2f2c84 (patch) | |
tree | 40dabd238fca9767fcbaeb372fc39e3341fed984 /src | |
parent | 0afec284903b24ee5f54178ff2274734cfc2814c (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.cpp | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/src/server/game/Spells/Spell.cpp b/src/server/game/Spells/Spell.cpp index 627e64c87b7..bb1a07a241f 100644 --- a/src/server/game/Spells/Spell.cpp +++ b/src/server/game/Spells/Spell.cpp @@ -1077,6 +1077,11 @@ void Spell::SelectImplicitNearbyTargets(SpellEffIndex effIndex, SpellImplicitTar { if (focusObject) AddGOTarget(focusObject, effMask); + else + { + SendCastResult(SPELL_FAILED_BAD_IMPLICIT_TARGETS); + finish(false); + } return; } break; @@ -1089,6 +1094,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; @@ -1101,6 +1111,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; } @@ -1108,6 +1120,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; } @@ -1119,6 +1133,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; @@ -1128,6 +1144,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; |