Core/Spells: Don't set TARGET_FLAG_DEST_LOCATION for cone targets

This commit is contained in:
Shauren
2025-06-01 18:44:36 +02:00
parent 6f23a46bb4
commit 0fba073d1a
2 changed files with 10 additions and 18 deletions

View File

@@ -1250,20 +1250,13 @@ void Spell::SelectImplicitNearbyTargets(SpellEffectInfo const& spellEffectInfo,
void Spell::SelectImplicitConeTargets(SpellEffectInfo const& spellEffectInfo, SpellImplicitTargetInfo const& targetType, SpellTargetIndex targetIndex, uint32 effMask)
{
Position coneSrc = m_caster->GetPosition();
float coneAngle = m_spellInfo->ConeAngle;
switch (targetType.GetReferenceType())
if (targetType.GetReferenceType() != TARGET_REFERENCE_TYPE_CASTER)
{
case TARGET_REFERENCE_TYPE_CASTER:
break;
case TARGET_REFERENCE_TYPE_DEST:
if (m_caster->GetExactDist2d(m_targets.GetDstPos()) > 0.1f)
coneSrc.SetOrientation(m_caster->GetAbsoluteAngle(m_targets.GetDstPos()));
break;
default:
break;
ABORT_MSG("Spell::SelectImplicitConeTargets: received not implemented target reference type");
return;
}
float coneAngle = m_spellInfo->ConeAngle;
switch (targetType.GetTarget())
{
case TARGET_UNIT_CONE_180_DEG_ENEMY:
@@ -1283,7 +1276,7 @@ void Spell::SelectImplicitConeTargets(SpellEffectInfo const& spellEffectInfo, Sp
if (uint32 containerTypeMask = GetSearcherTypeMask(m_spellInfo, spellEffectInfo, objectType, condList))
{
float extraSearchRadius = radius > 0.0f ? EXTRA_CELL_SEARCH_RADIUS : 0.0f;
Trinity::WorldObjectSpellConeTargetCheck check(coneSrc, DegToRad(coneAngle), m_spellInfo->Width ? m_spellInfo->Width : m_caster->GetCombatReach(), radius, m_caster, m_spellInfo, selectionType, condList, objectType);
Trinity::WorldObjectSpellConeTargetCheck check(*m_caster, DegToRad(coneAngle), m_spellInfo->Width ? m_spellInfo->Width : m_caster->GetCombatReach(), radius, m_caster, m_spellInfo, selectionType, condList, objectType);
Trinity::WorldObjectListSearcher<Trinity::WorldObjectSpellConeTargetCheck> searcher(m_caster, targets, check, containerTypeMask);
SearchTargets<Trinity::WorldObjectListSearcher<Trinity::WorldObjectSpellConeTargetCheck> >(searcher, containerTypeMask, m_caster, m_caster, radius + extraSearchRadius);