mirror of
https://gitcode.com/GitHub_Trending/az/azerothcore-wotlk.git
synced 2026-10-10 07:06:38 +08:00
fix(Core/Spell): allow modify target dst of all target types (#26878)
Co-authored-by: joschiwald <[email protected]>
This commit is contained in:
@@ -1156,7 +1156,11 @@ void Spell::SelectImplicitNearbyTargets(SpellEffIndex effIndex, SpellImplicitTar
|
||||
if (m_spellInfo->RequiresSpellFocus)
|
||||
{
|
||||
if (focusObject)
|
||||
m_targets.SetDst(*focusObject);
|
||||
{
|
||||
SpellDestination dest(*focusObject);
|
||||
CallScriptDestinationTargetSelectHandlers(dest, effIndex, targetType);
|
||||
m_targets.SetDst(dest);
|
||||
}
|
||||
return;
|
||||
}
|
||||
break;
|
||||
@@ -1169,13 +1173,17 @@ void Spell::SelectImplicitNearbyTargets(SpellEffIndex effIndex, SpellImplicitTar
|
||||
if (!target)
|
||||
{
|
||||
LOG_DEBUG("spells.aura", "Spell::SelectImplicitNearbyTargets: cannot find nearby target for spell ID {}, effect {}", m_spellInfo->Id, effIndex);
|
||||
SendCastResult(SPELL_FAILED_BAD_IMPLICIT_TARGETS);
|
||||
finish(false);
|
||||
return;
|
||||
}
|
||||
|
||||
CallScriptObjectTargetSelectHandlers(target, effIndex, targetType);
|
||||
if (!target)
|
||||
{
|
||||
//LOG_DEBUG("spells", "Spell::SelectImplicitNearbyTargets: OnObjectTargetSelect script hook for spell Id {} set nullptr target, effect {}", m_spellInfo->Id, effIndex);
|
||||
LOG_DEBUG("spells.aura", "Spell::SelectImplicitNearbyTargets: OnObjectTargetSelect script hook for spell Id {} set nullptr target, effect {}", m_spellInfo->Id, effIndex);
|
||||
SendCastResult(SPELL_FAILED_BAD_IMPLICIT_TARGETS);
|
||||
finish(false);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -1196,7 +1204,9 @@ void Spell::SelectImplicitNearbyTargets(SpellEffIndex effIndex, SpellImplicitTar
|
||||
}
|
||||
else
|
||||
{
|
||||
//LOG_DEBUG("spells", "Spell::SelectImplicitNearbyTargets: OnObjectTargetSelect script hook for spell Id {} set object of wrong type, expected unit, got {}, effect {}", m_spellInfo->Id, target->GetGUID().GetTypeName(), effMask);
|
||||
LOG_DEBUG("spells.aura", "Spell::SelectImplicitNearbyTargets: OnObjectTargetSelect script hook for spell Id {} set object of wrong type, expected unit, got {}, effect {}", m_spellInfo->Id, target->GetGUID().GetTypeName(), effMask);
|
||||
SendCastResult(SPELL_FAILED_BAD_IMPLICIT_TARGETS);
|
||||
finish(false);
|
||||
return;
|
||||
}
|
||||
break;
|
||||
@@ -1206,13 +1216,19 @@ void Spell::SelectImplicitNearbyTargets(SpellEffIndex effIndex, SpellImplicitTar
|
||||
AddGOTarget(gobjTarget, effMask);
|
||||
else
|
||||
{
|
||||
//LOG_DEBUG("spells", "Spell::SelectImplicitNearbyTargets: OnObjectTargetSelect script hook for spell Id {} set object of wrong type, expected gameobject, got {}, effect {}", m_spellInfo->Id, target->GetGUID().GetTypeName(), effMask);
|
||||
LOG_DEBUG("spells.aura", "Spell::SelectImplicitNearbyTargets: OnObjectTargetSelect script hook for spell Id {} set object of wrong type, expected gameobject, got {}, effect {}", m_spellInfo->Id, target->GetGUID().GetTypeName(), effMask);
|
||||
SendCastResult(SPELL_FAILED_BAD_IMPLICIT_TARGETS);
|
||||
finish(false);
|
||||
return;
|
||||
}
|
||||
break;
|
||||
case TARGET_OBJECT_TYPE_DEST:
|
||||
m_targets.SetDst(*target);
|
||||
break;
|
||||
{
|
||||
SpellDestination dest(*target);
|
||||
CallScriptDestinationTargetSelectHandlers(dest, effIndex, targetType);
|
||||
m_targets.SetDst(dest);
|
||||
break;
|
||||
}
|
||||
default:
|
||||
ASSERT(false && "Spell::SelectImplicitNearbyTargets: received not implemented target object type");
|
||||
break;
|
||||
|
||||
Reference in New Issue
Block a user