Skip to content

Commit

Permalink
fix(Core/Spells): Seed of Corruption detonation should obey LoS (#10916)
Browse files Browse the repository at this point in the history
- Source: TrinityCore
- Closes #4521
  • Loading branch information
UltraNix committed Mar 18, 2022
1 parent a054bbe commit 4511cf5
Showing 1 changed file with 15 additions and 2 deletions.
17 changes: 15 additions & 2 deletions src/server/scripts/Spells/spell_warlock.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -660,8 +660,21 @@ class spell_warl_seed_of_corruption : public SpellScript

void FilterTargets(std::list<WorldObject*>& 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
Expand Down

0 comments on commit 4511cf5

Please sign in to comment.