diff --git a/src/server/scripts/Spells/spell_warlock.cpp b/src/server/scripts/Spells/spell_warlock.cpp index a74414756..a2ba11e09 100644 --- a/src/server/scripts/Spells/spell_warlock.cpp +++ b/src/server/scripts/Spells/spell_warlock.cpp @@ -660,8 +660,21 @@ class spell_warl_seed_of_corruption : public SpellScript void FilterTargets(std::list& targets) { - if (GetExplTargetUnit()) - targets.remove(GetExplTargetUnit()); + targets.remove_if([&](WorldObject const* target) + { + if (Unit const* unitTarget = target->ToUnit()) + { + if (WorldLocation const* dest = GetExplTargetDest()) + { + if (!unitTarget->IsWithinLOS(dest->GetPositionX(), dest->GetPositionY(), dest->GetPositionZ())) + { + return true; + } + } + } + + return false; + }); } void Register() override