Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- void FilterTargets(std::list<WorldObject*>& targets)
- {
- if (!GetCaster())
- return;
- if (targets.empty())
- return;
- std::list<GameObject*> goList;
- GetCaster()->GetGameObjectListWithEntryInGrid(goList, GO_CRYSTAL_WALL_COLLISION, 100.0f);
- if (!goList.empty())
- for (std::list<GameObject*>::const_iterator itr = goList.begin(); itr != goList.end(); ++itr)
- targets.remove_if(WallCheck(GetCaster(), (*itr)));
- }
- void Register() override
- {
- OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_dargrul_magma_wave_filter::FilterTargets, EFFECT_0, TARGET_UNIT_SRC_AREA_ENEMY);
- }
- private:
- class WallCheck
- {
- public:
- WallCheck(Unit* searcher, GameObject* go) : _searcher(searcher), _go(go) {}
- bool operator()(WorldObject* unit)
- {
- return (_go->IsInBetween(_searcher, unit, 4.0f));
- }
- private:
- Unit* _searcher;
- GameObject* _go;
- };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement