From 51657e44d1430a93a4256a535af0a67660c95119 Mon Sep 17 00:00:00 2001 From: Shauren Date: Tue, 9 Aug 2016 17:21:19 +0200 Subject: Core/Spells: Renamed some old and new spell effects --- src/server/game/Spells/Spell.cpp | 51 ++++++++++------------------------------ 1 file changed, 12 insertions(+), 39 deletions(-) (limited to 'src/server/game/Spells/Spell.cpp') diff --git a/src/server/game/Spells/Spell.cpp b/src/server/game/Spells/Spell.cpp index 5e07d43b4b4..16227861a26 100644 --- a/src/server/game/Spells/Spell.cpp +++ b/src/server/game/Spells/Spell.cpp @@ -6621,46 +6621,19 @@ bool Spell::CheckEffectTarget(Unit const* target, SpellEffectInfo const* effect, return true; /// @todo shit below shouldn't be here, but it's temporary - //Check targets for LOS visibility (except spells without range limitations) - switch (effect->Effect) + //Check targets for LOS visibility + if (losPosition) + return target->IsWithinLOS(losPosition->GetPositionX(), losPosition->GetPositionY(), losPosition->GetPositionZ()); + else { - case SPELL_EFFECT_RESURRECT_NEW: - // player far away, maybe his corpse near? - if (target != m_caster && !target->IsWithinLOSInMap(m_caster)) - { - if (!m_targets.GetCorpseTargetGUID()) - return false; - - Corpse* corpse = ObjectAccessor::GetCorpse(*m_caster, m_targets.GetCorpseTargetGUID()); - if (!corpse) - return false; - - if (target->GetGUID() != corpse->GetOwnerGUID()) - return false; - - if (!corpse->IsWithinLOSInMap(m_caster)) - return false; - } - - // all ok by some way or another, skip normal check - break; - default: // normal case - { - if (losPosition) - return target->IsWithinLOS(losPosition->GetPositionX(), losPosition->GetPositionY(), losPosition->GetPositionZ()); - else - { - // Get GO cast coordinates if original caster -> GO - WorldObject* caster = NULL; - if (m_originalCasterGUID.IsGameObject()) - caster = m_caster->GetMap()->GetGameObject(m_originalCasterGUID); - if (!caster) - caster = m_caster; - if (target != m_caster && !target->IsWithinLOSInMap(caster)) - return false; - } - break; - } + // Get GO cast coordinates if original caster -> GO + WorldObject* caster = NULL; + if (m_originalCasterGUID.IsGameObject()) + caster = m_caster->GetMap()->GetGameObject(m_originalCasterGUID); + if (!caster) + caster = m_caster; + if (target != m_caster && !target->IsWithinLOSInMap(caster)) + return false; } return true; -- cgit v1.2.3