aboutsummaryrefslogtreecommitdiff
path: root/src/server/game/Spells/Spell.cpp
diff options
context:
space:
mode:
authorShauren <shauren.trinity@gmail.com>2016-08-09 17:21:19 +0200
committerShauren <shauren.trinity@gmail.com>2016-08-09 17:21:19 +0200
commit51657e44d1430a93a4256a535af0a67660c95119 (patch)
treeeef7a4f67377ba2f390a3e8544e43ef56ec0c292 /src/server/game/Spells/Spell.cpp
parent8954b83d293e1554c2ba36c9ec3d4cdb8658d167 (diff)
Core/Spells: Renamed some old and new spell effects
Diffstat (limited to 'src/server/game/Spells/Spell.cpp')
-rw-r--r--src/server/game/Spells/Spell.cpp51
1 files changed, 12 insertions, 39 deletions
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;