Core/Spells: Set UNIT_FIELD_TARGET to current spell cast target for proper facing the target
This commit is contained in:
@@ -528,7 +528,7 @@ m_caster(Caster), m_spellValue(new SpellValue(m_spellInfo))
|
||||
|
||||
// Determine if spell can be reflected back to the caster
|
||||
// Patch 1.2 notes: Spell Reflection no longer reflects abilities
|
||||
m_canReflect = m_spellInfo->DmgClass == SPELL_DAMAGE_CLASS_MAGIC && !(m_spellInfo->Attributes & SPELL_ATTR0_ABILITY)
|
||||
m_canReflect = m_spellInfo->DmgClass == SPELL_DAMAGE_CLASS_MAGIC && !(m_spellInfo->Attributes & SPELL_ATTR0_ABILITY)
|
||||
&& !(m_spellInfo->AttributesEx & SPELL_ATTR1_CANT_BE_REFLECTED) && !(m_spellInfo->Attributes & SPELL_ATTR0_UNAFFECTED_BY_INVULNERABILITY)
|
||||
&& !IsPassiveSpell(m_spellInfo) && !IsPositiveSpell(m_spellInfo->Id);
|
||||
|
||||
@@ -2944,6 +2944,12 @@ void Spell::prepare(SpellCastTargets const* targets, AuraEffect const* triggered
|
||||
m_caster->SetCurrentCastedSpell(this);
|
||||
SendSpellStart();
|
||||
|
||||
// set target for proper facing
|
||||
if (m_casttime && !m_IsTriggeredSpell)
|
||||
if (uint64 target = m_targets.GetUnitTargetGUID())
|
||||
if (m_caster->GetGUID() != target && m_caster->GetTypeId() == TYPEID_UNIT)
|
||||
m_caster->FocusTarget(this, target);
|
||||
|
||||
TriggerGlobalCooldown();
|
||||
|
||||
//item: first cast may destroy item and second cast causes crash
|
||||
@@ -3578,6 +3584,9 @@ void Spell::finish(bool ok)
|
||||
((Puppet*)charm)->UnSummon();
|
||||
}
|
||||
|
||||
if (m_caster->GetTypeId() == TYPEID_UNIT)
|
||||
m_caster->ReleaseFocus(this);
|
||||
|
||||
if (!ok)
|
||||
return;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user