diff options
| -rwxr-xr-x | src/server/game/Spells/Spell.cpp | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/server/game/Spells/Spell.cpp b/src/server/game/Spells/Spell.cpp index b1aeb41a126..67d4c542024 100755 --- a/src/server/game/Spells/Spell.cpp +++ b/src/server/game/Spells/Spell.cpp @@ -4767,6 +4767,16 @@ SpellCastResult Spell::CheckCast(bool strict) } } + //Check for line of sight for spells with dest + if (m_targets.HasDst()) + { + float x, y, z; + m_targets.GetDst()->GetPosition(x, y, z); + + if (!(m_spellInfo->AttributesEx2 & SPELL_ATTR2_CAN_TARGET_NOT_IN_LOS) && VMAP::VMapFactory::checkSpellForLoS(m_spellInfo->Id) && !m_caster->IsWithinLOS(x, y, z)) + return SPELL_FAILED_LINE_OF_SIGHT; + } + // check pet presence for (int j = 0; j < MAX_SPELL_EFFECTS; ++j) { |
