diff options
author | Shauren <shauren.trinity@gmail.com> | 2011-07-15 12:33:03 +0200 |
---|---|---|
committer | Shauren <shauren.trinity@gmail.com> | 2011-07-15 12:33:03 +0200 |
commit | 1e3c23a4e8de3ea1ee99d159f0ca34c9cc055ed3 (patch) | |
tree | e979780ed1c3adb4e6bed316ccf0cba4fdb3b9b9 /src/server/game/Spells/Spell.cpp | |
parent | 944fb4c1b77ca2a021c135100219fdc2bc62f0a8 (diff) |
Core/Spells: Set UNIT_FIELD_TARGET to current spell cast target for proper facing the target
Diffstat (limited to 'src/server/game/Spells/Spell.cpp')
-rwxr-xr-x | src/server/game/Spells/Spell.cpp | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/src/server/game/Spells/Spell.cpp b/src/server/game/Spells/Spell.cpp index 1759f8bae08..97dfc8bd188 100755 --- a/src/server/game/Spells/Spell.cpp +++ b/src/server/game/Spells/Spell.cpp @@ -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; |