diff options
| author | Giuseppe Montesanto <montesanto.giuseppe@live.it> | 2012-02-02 19:06:28 +0100 |
|---|---|---|
| committer | Giuseppe Montesanto <montesanto.giuseppe@live.it> | 2012-02-02 19:06:28 +0100 |
| commit | 16300d091464f2202f3f029f0a18f0ed23d915d3 (patch) | |
| tree | 6462f00864e13f5d8780d56dc71eef27cbd02f9d /src | |
| parent | e447e903ec947f8aff5dd56cfacf9f8d054bff68 (diff) | |
Check line of sight for spell with dest
Diffstat (limited to 'src')
| -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 3c73edb880d..d5d52d3f98f 100755 --- a/src/server/game/Spells/Spell.cpp +++ b/src/server/game/Spells/Spell.cpp @@ -4769,6 +4769,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) { |
