fix(Core/Spells): Seed of Corruption detonation should obey LoS (#10916)

- Source: TrinityCore
- Closes #4521
This commit is contained in:
UltraNix
2022-03-18 13:05:20 +01:00
committed by GitHub
parent a054bbeabf
commit 4511cf5751

View File

@@ -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