Advertisement
Guest User

Untitled

a guest
Dec 5th, 2019
86
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.13 KB | None | 0 0
  1. void FilterTargets(std::list<WorldObject*>& targets)
  2. {
  3. if (!GetCaster())
  4. return;
  5.  
  6. if (targets.empty())
  7. return;
  8.  
  9. std::list<GameObject*> goList;
  10.  
  11. GetCaster()->GetGameObjectListWithEntryInGrid(goList, GO_CRYSTAL_WALL_COLLISION, 100.0f);
  12.  
  13. if (!goList.empty())
  14. for (std::list<GameObject*>::const_iterator itr = goList.begin(); itr != goList.end(); ++itr)
  15. targets.remove_if(WallCheck(GetCaster(), (*itr)));
  16. }
  17.  
  18. void Register() override
  19. {
  20. OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_dargrul_magma_wave_filter::FilterTargets, EFFECT_0, TARGET_UNIT_SRC_AREA_ENEMY);
  21. }
  22.  
  23. private:
  24. class WallCheck
  25. {
  26. public:
  27. WallCheck(Unit* searcher, GameObject* go) : _searcher(searcher), _go(go) {}
  28.  
  29. bool operator()(WorldObject* unit)
  30. {
  31. return (_go->IsInBetween(_searcher, unit, 4.0f));
  32. }
  33.  
  34. private:
  35. Unit* _searcher;
  36. GameObject* _go;
  37. };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement