mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-16 15:40:45 +01:00
Core/Spells: Spell casts should be interrupted if the target goes out of LoS.
Signed-off-by: Subv <s.v.h21@hotmail.com>
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user