mirror of
https://github.com/mangosfour/server.git
synced 2025-12-14 16:37:01 +00:00
[10385] Remove Unit::GetUnit and update it callers.
This commit is contained in:
parent
dcc9dc25ae
commit
77ae9a63b8
7 changed files with 40 additions and 50 deletions
|
|
@ -4336,8 +4336,7 @@ SpellCastResult Spell::CheckCast(bool strict)
|
|||
}
|
||||
else if (m_caster == target)
|
||||
{
|
||||
|
||||
if (m_caster->GetTypeId() == TYPEID_PLAYER) // Target - is player caster
|
||||
if (m_caster->GetTypeId() == TYPEID_PLAYER && m_caster->IsInWorld())
|
||||
{
|
||||
// Additional check for some spells
|
||||
// If 0 spell effect empty - client not send target data (need use selection)
|
||||
|
|
@ -4345,7 +4344,7 @@ SpellCastResult Spell::CheckCast(bool strict)
|
|||
if (m_targets.m_targetMask == TARGET_FLAG_SELF &&
|
||||
m_spellInfo->EffectImplicitTargetA[EFFECT_INDEX_1] == TARGET_CHAIN_DAMAGE)
|
||||
{
|
||||
if (target = m_caster->GetUnit(*m_caster, ((Player *)m_caster)->GetSelection()))
|
||||
if (target = m_caster->GetMap()->GetUnit(((Player *)m_caster)->GetSelection()))
|
||||
m_targets.setUnitTarget(target);
|
||||
else
|
||||
return SPELL_FAILED_BAD_TARGETS;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue