aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorSubv <s.v.h21@hotmail.com>2012-02-12 15:30:16 -0500
committerSubv <s.v.h21@hotmail.com>2012-02-12 15:30:16 -0500
commit5ea49613d24ad10b305891a39340155058e5a67e (patch)
tree68a864fc7d4971a04132fb3eaaddf5df30bf1cea /src
parentca2324b5eee18d0d0b7643f36e0d45355665a067 (diff)
Core/Spells: Spell casts should be interrupted if the target goes out of LoS.
Signed-off-by: Subv <s.v.h21@hotmail.com>
Diffstat (limited to 'src')
-rwxr-xr-xsrc/server/game/Spells/Spell.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/server/game/Spells/Spell.cpp b/src/server/game/Spells/Spell.cpp
index 7c578a39355..fda186f9c64 100755
--- a/src/server/game/Spells/Spell.cpp
+++ b/src/server/game/Spells/Spell.cpp
@@ -3481,6 +3481,14 @@ void Spell::update(uint32 difftime)
{
if (m_timer > 0)
{
+ // Cancel the cast if the target is not in line of sight
+ if (m_targets.GetUnitTarget() && !m_caster->IsWithinLOSInMap(m_targets.GetUnitTarget()))
+ {
+ SendCastResult(SPELL_FAILED_LINE_OF_SIGHT);
+ cancel();
+ return;
+ }
+
if (difftime >= (uint32)m_timer)
m_timer = 0;
else