diff options
| author | QAston <qaston@gmail.com> | 2011-08-20 00:29:57 +0200 |
|---|---|---|
| committer | QAston <qaston@gmail.com> | 2011-08-20 00:30:38 +0200 |
| commit | e2d8faea093ab9aeeca1bbd8bba98fb06527a35b (patch) | |
| tree | e9b760a5496b934d852b8fb52eea6c60710dafbd /src/server/game/Maps | |
| parent | cd03dadb7fd46f186bb39c6848d553902a48f495 (diff) | |
Core/Spells: move Cannibalize and Carrion Feeder cast checks to SpellScripts.
Diffstat (limited to 'src/server/game/Maps')
| -rwxr-xr-x | src/server/game/Maps/Map.h | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/src/server/game/Maps/Map.h b/src/server/game/Maps/Map.h index 6ff4bf05d42..f430002fca6 100755 --- a/src/server/game/Maps/Map.h +++ b/src/server/game/Maps/Map.h @@ -416,6 +416,7 @@ class Map : public GridRefManager<NGridType> template<class T> void SwitchGridContainers(T* obj, bool active); template<class NOTIFIER> void VisitAll(const float &x, const float &y, float radius, NOTIFIER ¬ifier); + template<class NOTIFIER> void VisitFirstFound(const float &x, const float &y, float radius, NOTIFIER ¬ifier); template<class NOTIFIER> void VisitWorld(const float &x, const float &y, float radius, NOTIFIER ¬ifier); template<class NOTIFIER> void VisitGrid(const float &x, const float &y, float radius, NOTIFIER ¬ifier); CreatureGroupHolderType CreatureGroupHolder; @@ -650,6 +651,25 @@ Map::VisitAll(const float &x, const float &y, float radius, NOTIFIER ¬ifier) cell.Visit(p, grid_object_notifier, *this, radius, x, y); } +// should be used with Searcher notifiers, tries to search world if nothing found in grid +template<class NOTIFIER> +inline void +Map::VisitFirstFound(const float &x, const float &y, float radius, NOTIFIER ¬ifier) +{ + CellPair p(Trinity::ComputeCellPair(x, y)); + Cell cell(p); + cell.data.Part.reserved = ALL_DISTRICT; + cell.SetNoCreate(); + + TypeContainerVisitor<NOTIFIER, WorldTypeMapContainer> world_object_notifier(notifier); + cell.Visit(p, world_object_notifier, *this, radius, x, y); + if (!notifier.i_object) + { + TypeContainerVisitor<NOTIFIER, GridTypeMapContainer > grid_object_notifier(notifier); + cell.Visit(p, grid_object_notifier, *this, radius, x, y); + } +} + template<class NOTIFIER> inline void Map::VisitWorld(const float &x, const float &y, float radius, NOTIFIER ¬ifier) |
