Core/Spells: Spells with TARGET_SELECT_CATEGORY_NEARBY requires a valid target (#20954)
This commit is contained in:
1 parent
2cae35fe86
commit
9ea8214254
2 files changed
+55
No files matched your search
@@ -1054,6 +1054,11 @@ void Spell::SelectImplicitNearbyTargets(SpellEffIndex effIndex, SpellImplicitTar
|
||||
{
|
||||
if (focusObject)
|
||||
AddGOTarget(focusObject, effMask);
|
||||
else
|
||||
{
|
||||
SendCastResult(SPELL_FAILED_BAD_IMPLICIT_TARGETS);
|
||||
finish(false);
|
||||
}
|
||||
return;
|
||||
}
|
||||
break;
|
||||
@@ -1066,6 +1071,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;
|
||||
@@ -1078,6 +1088,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;
|
||||
}
|
||||
|
||||
@@ -1085,6 +1097,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;
|
||||
}
|
||||
|
||||
@@ -1096,6 +1110,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;
|
||||
@@ -1105,6 +1121,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;
|
||||
|
||||
Reference in new issue
Block a user