Core/Spells: Improved spell explicit target fallback selection for unit targets when spell target comes from client
Client only looks at target type of first spell effect to determine what additional target info to send in packet outside of Spell.dbc Targets column Closes #11566 Closes #29809 (cherry picked from commit 5d7ae76d6f2a0f6f6416ff754d2243f3aafcc7d5)
This commit is contained in:
@@ -733,7 +733,7 @@ void WorldSession::HandlePetCastSpellOpcode(WorldPackets::Spells::PetCastSpell&
|
||||
Spell* spell = new Spell(caster, spellInfo, triggerCastFlags);
|
||||
spell->m_fromClient = true;
|
||||
std::ranges::copy(petCastSpell.Cast.Misc, std::ranges::begin(spell->m_misc.Raw.Data));
|
||||
spell->m_targets = targets;
|
||||
spell->InitExplicitTargets(targets);
|
||||
|
||||
SpellCastResult result = spell->CheckPetCast(nullptr);
|
||||
|
||||
|
||||
@@ -655,7 +655,7 @@ void Spell::InitExplicitTargets(SpellCastTargets const& targets)
|
||||
unit = m_caster->ToUnit()->GetVictim();
|
||||
|
||||
// didn't find anything - let's use self as target
|
||||
if (!unit && neededTargets & (TARGET_FLAG_UNIT_RAID | TARGET_FLAG_UNIT_PARTY | TARGET_FLAG_UNIT_ALLY))
|
||||
if (!unit && (neededTargets & (TARGET_FLAG_UNIT_ENEMY | TARGET_FLAG_UNIT_DEAD | TARGET_FLAG_UNIT_MINIPET | TARGET_FLAG_UNIT_PASSENGER)) == 0)
|
||||
unit = m_caster->ToUnit();
|
||||
|
||||
m_targets.SetUnitTarget(unit);
|
||||
|
||||
Reference in New Issue
Block a user