diff options
author | ekekekkekkek <96571151+eusss@users.noreply.github.com> | 2025-09-11 15:46:34 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2025-09-11 10:46:34 -0300 |
commit | 110fd070f2f6fe5926b7330c5f33b89e59f2c69c (patch) | |
tree | 718792fd44a1e22944e656fb4b6393beae056c6a /src/server | |
parent | f334a38c5e1ec45bb96d278538352fcc86b1199a (diff) |
fix(Scripts/Spells): Druid ability Starfall now will no longer try to hit outside line of sight targets (#22422)
Co-authored-by: Tereneckla <Tereneckla@pm.me>
Diffstat (limited to 'src/server')
-rw-r--r-- | src/server/scripts/Spells/spell_druid.cpp | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/src/server/scripts/Spells/spell_druid.cpp b/src/server/scripts/Spells/spell_druid.cpp index ededde81eb..c388af6344 100644 --- a/src/server/scripts/Spells/spell_druid.cpp +++ b/src/server/scripts/Spells/spell_druid.cpp @@ -923,6 +923,21 @@ class spell_dru_starfall_dummy : public SpellScript void FilterTargets(std::list<WorldObject*>& targets) { + // Get caster object + Unit* caster = GetCaster(); + + // Remove targets if they are outside line of sight with respect to caster + targets.remove_if([caster](WorldObject const* target) + { + if (target) + { + if (!caster->IsWithinLOS(target->GetPositionX(), target->GetPositionY(), target->GetPositionZ())) + return true; + } + return false; + }); + + // Take 2 random targets from remaining within line of sight targets Acore::Containers::RandomResize(targets, 2); } |